MCPcopy Index your code
hub / github.com/pytorch/pytorch / testStructSubclassClone

Method testStructSubclassClone

caffe2/python/schema_test.py:71–81  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

69 self.assertIsNot(clone, s)
70
71 def testStructSubclassClone(self):
72 class Subclass(schema.Struct):
73 pass
74
75 s = Subclass(
76 ('a', schema.Scalar()),
77 )
78 clone = s.clone()
79 self.assertIsInstance(clone, Subclass)
80 self.assertEqual(s, clone)
81 self.assertIsNot(clone, s)
82
83 def testNormalizeField(self):
84 s = schema.Struct(('field1', np.int32), ('field2', str))

Callers

nothing calls this directly

Calls 3

SubclassClass · 0.85
cloneMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected