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

Method _CheckLookupTables

caffe2/python/core.py:1993–2008  ·  view source on GitHub ↗

Called from unit tests to validate the internal lookup tables match the protobuf contents.

(self)

Source from the content-addressed store, hash-verified

1991 self._op_outputs.update([str(o) for o in op.output])
1992
1993 def _CheckLookupTables(self):
1994 '''
1995 Called from unit tests to validate the internal lookup tables
1996 match the protobuf contents.
1997 '''
1998 test_op_outputs = set()
1999 for op in self._net.op:
2000 for o in op.output:
2001 test_op_outputs.add(o)
2002
2003 test_external_inp = set()
2004 for inp in self._net.external_input:
2005 test_external_inp.add(inp)
2006
2007 assert test_op_outputs.difference(self._op_outputs) == set()
2008 assert test_external_inp.difference(self._external_input_map) == set()
2009
2010 def _InvalidateLookupTables(self):
2011 self._recreate_lookup_tables = True

Callers 3

testPartialCloneMethod · 0.95
test_auto_namingMethod · 0.95
CreateFunction · 0.80

Calls 1

addMethod · 0.45

Tested by 2

testPartialCloneMethod · 0.76
test_auto_namingMethod · 0.76