MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / get_tensor

Method get_tensor

tensorflow/lite/python/interpreter.py:375–388  ·  view source on GitHub ↗

Gets the value of the input tensor (get a copy). If you wish to avoid the copy, use `tensor()`. This function cannot be used to read intermediate results. Args: tensor_index: Tensor index of tensor to get. This value can be gotten from the 'index' field in get

(self, tensor_index)

Source from the content-addressed store, hash-verified

373 ]
374
375 def get_tensor(self, tensor_index):
376 """Gets the value of the input tensor (get a copy).
377
378 If you wish to avoid the copy, use `tensor()`. This function cannot be used
379 to read intermediate results.
380
381 Args:
382 tensor_index: Tensor index of tensor to get. This value can be gotten from
383 the 'index' field in get_output_details.
384
385 Returns:
386 a numpy array.
387 """
388 return self._interpreter.GetTensor(tensor_index)
389
390 def tensor(self, tensor_index):
391 """Returns function that gives a numpy view of the current tensor buffer.

Callers 15

testScalarValidMethod · 0.95
_evaluateTFLiteModelMethod · 0.95
testScalarValidMethod · 0.95
testSequentialModelMethod · 0.95
testCustomLayerMethod · 0.95
testFunctionalModelMethod · 0.95
testFloatMethod · 0.95
testUint8Method · 0.95
testStringMethod · 0.95
_evaluateTFLiteModelMethod · 0.95

Calls 1

GetTensorMethod · 0.45

Tested by 15

testScalarValidMethod · 0.76
_evaluateTFLiteModelMethod · 0.76
testScalarValidMethod · 0.76
testSequentialModelMethod · 0.76
testCustomLayerMethod · 0.76
testFunctionalModelMethod · 0.76
testFloatMethod · 0.76
testUint8Method · 0.76
testStringMethod · 0.76
_evaluateTFLiteModelMethod · 0.76