Called from unit tests to validate the internal lookup tables match the protobuf contents.
(self)
| 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 |