View Source TFLiteBEAM.TFLiteTensor (tflite_beam v0.2.0)
A typed multi-dimensional array used in Tensorflow Lite.
Link to this section 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
Link to this section Types
Link to this section Functions
@spec dims(%TFLiteBEAM.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( %TFLiteBEAM.TFLiteTensor{ index: term(), name: term(), quantization_params: term(), reference: term(), shape: term(), shape_signature: term(), sparsity_params: term(), type: term() } | reference() ) :: %TFLiteBEAM.TFLiteQuantizationParams{ quantized_dimension: term(), scale: term(), zero_point: term() } | nif_error()
Get the quantization params
@spec set_data( %TFLiteBEAM.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()} ) :: :ok | nif_error()
Set tensor data
@spec shape(%TFLiteBEAM.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( %TFLiteBEAM.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() | %TFLiteBEAM.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()}
Convert TFLiteBEAM.TFLiteTensor
to Nx.Tensor
@spec type(%TFLiteBEAM.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