Resizes an input tensor. Args: input_index: Tensor index of input to set. This value can be gotten from the 'index' field in get_input_details. tensor_size: The tensor_shape to resize the input to. Raises: ValueError: If the interpreter could not resize
(self, input_index, tensor_size)
| 346 | self._interpreter.SetTensor(tensor_index, value) |
| 347 | |
| 348 | def resize_tensor_input(self, input_index, tensor_size): |
| 349 | """Resizes an input tensor. |
| 350 | |
| 351 | Args: |
| 352 | input_index: Tensor index of input to set. This value can be gotten from |
| 353 | the 'index' field in get_input_details. |
| 354 | tensor_size: The tensor_shape to resize the input to. |
| 355 | |
| 356 | Raises: |
| 357 | ValueError: If the interpreter could not resize the input tensor. |
| 358 | """ |
| 359 | self._ensure_safe() |
| 360 | # `ResizeInputTensor` now only accepts int32 numpy array as `tensor_size |
| 361 | # parameter. |
| 362 | tensor_size = np.array(tensor_size, dtype=np.int32) |
| 363 | self._interpreter.ResizeInputTensor(input_index, tensor_size) |
| 364 | |
| 365 | def get_output_details(self): |
| 366 | """Gets model output details. |