MCPcopy Create free account
hub / github.com/pytorch/pytorch / assertNetContainOps

Method assertNetContainOps

caffe2/python/layer_test_util.py:127–139  ·  view source on GitHub ↗

Given a net and a list of OpSpec's, check that the net match the spec

(self, net, op_specs)

Source from the content-addressed store, hash-verified

125 self.assertEqual(parse_args(spec_args), op_args)
126
127 def assertNetContainOps(self, net, op_specs):
128 """
129 Given a net and a list of OpSpec's, check that the net match the spec
130 """
131 ops = net.Proto().op
132 self.assertEqual(len(op_specs), len(ops))
133 for op, op_spec in zip(ops, op_specs):
134 self.assertEqual(op_spec.type, op.type)
135 self.assertBlobsEqual(op_spec.input, op.input)
136 self.assertBlobsEqual(op_spec.output, op.output)
137 if op_spec.arg is not None:
138 self.assertArgsEqual(op_spec.arg, op.arg)
139 return ops

Calls 4

assertBlobsEqualMethod · 0.95
assertArgsEqualMethod · 0.95
ProtoMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected