BB.Inference.Description.Tensor (bb_inference v0.1.0)

Copy Markdown View Source

One input or output of a model.

  • name - what the model calls it; the key in run/2's maps
  • shape - a tuple of dimensions, any of which may be nil where the model leaves it dynamic; nil if the runtime can't report a shape at all
  • type - the Nx.Type the runtime takes or gives, which for a quantised tensor is the raw integer type
  • layout - :nchw, :nhwc or another layout the runtime reports, or nil when it doesn't know
  • quantisation - how the raw values map to real ones, or nil if the tensor isn't quantised or the runtime can't say

Summary

Functions

A short summary for error messages: images {1, 3, 416, 416} f32.

Types

dimension()

@type dimension() :: non_neg_integer() | nil

t()

@type t() :: %BB.Inference.Description.Tensor{
  layout: atom() | nil,
  name: String.t(),
  quantisation: BB.Inference.Quantisation.t() | nil,
  shape: tuple() | nil,
  type: Nx.Type.t() | nil
}

Functions

summary(tensor)

@spec summary(t()) :: String.t()

A short summary for error messages: images {1, 3, 416, 416} f32.