Example #1
0
 def __init__(self, model: Model, subgraph: SubGraph,
              subgraph_idx: int) -> None:
     self._model = model
     self._subgraph = subgraph
     self._subgraph_idx = subgraph_idx
     self._tensors = [
         TFLiteTensorWrapper(self._subgraph.Tensors(idx), self._model)
         for idx in range(self._subgraph.TensorsLength())
     ]
     self._nodes = [
         TFLiteNode(self._subgraph.Operators(idx), idx, self._model, self)
         for idx in range(self._subgraph.OperatorsLength())
     ]
Example #2
0
 def __init__(self,
              model: Model,
              subgraph: SubGraph,
              subgraph_idx: int,
              name_cache=None,
              anonymise=False) -> None:
     self._model = model
     self._subgraph = subgraph
     self._subgraph_idx = subgraph_idx
     self._tensors = [
         TFLiteTensorWrapper(self._subgraph.Tensors(idx), self._model)
         for idx in range(self._subgraph.TensorsLength())
     ]
     self._nodes = [
         TFLiteNode(self._subgraph.Operators(idx),
                    idx,
                    self._model,
                    self,
                    name_cache=name_cache,
                    anonymise=anonymise)
         for idx in range(self._subgraph.OperatorsLength())
     ]