mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 12:20:52 +01:00
Summary: We have to use copy constructor in Concat when copying non-primitive types Reviewed By: Yangqing Differential Revision: D6002883 fbshipit-source-id: 0aebc955079975bb6423291589ed09ce0660acf3
29 lines
738 B
Python
29 lines
738 B
Python
from __future__ import absolute_import
|
|
from __future__ import division
|
|
from __future__ import print_function
|
|
|
|
from caffe2.python import core, workspace
|
|
import unittest
|
|
|
|
core.GlobalInit(['python'])
|
|
|
|
|
|
class BlobDeallocationTest(unittest.TestCase):
|
|
def test(self):
|
|
net = core.Net('net')
|
|
|
|
x = net.GivenTensorStringFill([], ['x'], shape=[3], values=['a', 'b', 'c'])
|
|
y = net.GivenTensorStringFill([], ['y'], shape=[3], values=['d', 'e', 'f'])
|
|
net.Concat([x, y], ['concated', '_'], axis=0)
|
|
|
|
workspace.ResetWorkspace()
|
|
workspace.RunNetOnce(net)
|
|
|
|
workspace.ResetWorkspace()
|
|
workspace.RunNetOnce(net)
|
|
self.assertTrue(True)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|