View Source TFLiteElixir.TFLiteTensor (tflite_elixir v0.1.2)

Link to this section Summary

Functions

Get the dimensions

Raising version of dims/1.

Get the quantization params

Set tensor data

Raising version of set_data/2.

Get binary data

Raising version of to_binary/2.

To Nx.Tensor

Raising version of to_nx/1.

Get the data type

Raising version of type/1.

Link to this section Types

@type nif_error() :: {:error, String.t()}
@type nif_resource_ok() :: {:ok, reference()}
@type tensor_type() ::
  :no_type
  | {:f, 32}
  | {:s, 32}
  | {:u, 8}
  | {:s, 64}
  | :string
  | :bool
  | {:s, 16}
  | {:c, 64}
  | {:s, 8}
  | {:f, 16}
  | {:f, 64}
  | {:c, 128}
  | {:u, 64}
  | :resource
  | :variant
  | {:u, 32}

Link to this section 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(%Nx.Tensor{data: term(), names: term(), shape: term(), type: term()}) :: [
  integer()
]
@spec dims(reference()) :: {:ok, [integer()]} | nif_error()

Get the dimensions

Raising version of dims/1.

Link to this function

quantization_params(self)

View Source

Get the quantization params

Link to this function

quantization_params!(self)

View Source

Raising version of quantization_params/1.

Set tensor data

Raising version of set_data/2.

Link to this function

to_binary(self, limit \\ 0)

View Source
@spec to_binary(
  %TFLiteElixir.TFLiteTensor{
    index: term(),
    name: term(),
    quantization_params: term(),
    reference: term(),
    shape: term(),
    shape_signature: term(),
    sparsity_params: term(),
    type: term()
  },
  non_neg_integer()
) :: binary()
@spec to_binary(reference(), non_neg_integer()) :: binary()

Get binary data

Raising version of to_binary/2.

@spec to_nx(%TFLiteElixir.TFLiteTensor{
  index: term(),
  name: term(),
  quantization_params: term(),
  reference: term(),
  shape: term(),
  shape_signature: term(),
  sparsity_params: term(),
  type: term()
}) :: binary()
@spec to_nx(reference()) :: binary()

To Nx.Tensor

Raising version of to_nx/1.

@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(%Nx.Tensor{data: term(), names: term(), shape: term(), type: term()}) ::
  tensor_type()
@spec type(reference()) :: tensor_type() | nif_error()

Get the data type

Raising version of type/1.