View Source TFLiteElixir.TFLiteTensor (tflite_elixir v0.3.7)
A typed multi-dimensional array used in Tensorflow Lite.
Summary
Functions
Get the dimensions (C++) API
Get the quantization params
Set tensor data
Get the tensor shape
Get binary data
Get the data type
Types
Functions
@spec dims(%TFLiteElixir.TFLiteTensor{ index: term(), name: term(), quantization_params: term(), reference: term(), shape: term(), shape_signature: term(), sparsity_params: term(), type: term() }) :: [integer()]
@spec dims(reference()) :: [integer()] | nif_error()
Get the dimensions (C++) API
@spec quantization_params( %TFLiteElixir.TFLiteTensor{ index: term(), name: term(), quantization_params: term(), reference: term(), shape: term(), shape_signature: term(), sparsity_params: term(), type: term() } | reference() ) :: %TFLiteElixir.TFLiteQuantizationParams{ quantized_dimension: term(), scale: term(), zero_point: term() } | nif_error()
Get the quantization params
@spec set_data( %TFLiteElixir.TFLiteTensor{ index: term(), name: term(), quantization_params: term(), reference: term(), shape: term(), shape_signature: term(), sparsity_params: term(), type: term() } | reference(), binary() | %Nx.Tensor{ data: term(), names: term(), shape: term(), type: term(), vectorized_axes: term() } ) :: :ok | nif_error()
Set tensor data
@spec shape(%TFLiteElixir.TFLiteTensor{ index: term(), name: term(), quantization_params: term(), reference: term(), shape: term(), shape_signature: term(), sparsity_params: term(), type: term() }) :: tuple()
@spec shape(reference()) :: tuple() | nif_error()
Get the tensor shape
@spec to_binary( %TFLiteElixir.TFLiteTensor{ index: term(), name: term(), quantization_params: term(), reference: term(), shape: term(), shape_signature: term(), sparsity_params: term(), type: term() } | reference(), non_neg_integer() ) :: binary() | {:error, String.t()}
Get binary data
@spec to_nx( reference() | %TFLiteElixir.TFLiteTensor{ index: term(), name: term(), quantization_params: term(), reference: term(), shape: term(), shape_signature: term(), sparsity_params: term(), type: term() }, Keyword.t() ) :: %Nx.Tensor{ data: term(), names: term(), shape: term(), type: term(), vectorized_axes: term() }
Convert TFLiteElixir.TFLiteTensor
to Nx.Tensor
@spec type(%TFLiteElixir.TFLiteTensor{ index: term(), name: term(), quantization_params: term(), reference: term(), shape: term(), shape_signature: term(), sparsity_params: term(), type: term() }) :: tensor_type()
@spec type(reference()) :: tensor_type() | nif_error()
Get the data type