View source on GitHub |
Computes the flat size (number of elements) of tensor shape.
tflite_support.metadata_writers.writer_utils.compute_flat_size(
tensor_shape: Optional['array.array[int]']
) -> int
Args | |
---|---|
tensor_shape
|
an array of the tensor shape values. |
Returns | |
---|---|
The flat size of the tensor shape. Return 0 if tensor_shape is None. |