tfd.tensor

TF_Tensor wrapper.

Members

Aliases

Tensor
alias Tensor = SlimRCPtr!TensorOwner
bfloat16
alias bfloat16 = CustomFloat!(7, 8)

bfloat16: https://en.wikipedia.org/wiki/Bfloat16_floating-point_format

half
alias half = CustomFloat!(10, 5)

IEEE 754-2008 half: https://en.wikipedia.org/wiki/Half-precision_floating-point_format

size_t
alias size_t = object.size_t
Undocumented in source.
tfdTypePairList
alias tfdTypePairList = AliasSeq!(TFDPair!(float, TF_FLOAT), TFDPair!(double, TF_DOUBLE), TFDPair!(int, TF_INT32), TFDPair!(ubyte, TF_UINT8), TFDPair!(short, TF_INT16), TFDPair!(byte, TF_INT8), TFDPair!(string, TF_STRING), TFDPair!(Complex!float, TF_COMPLEX64), TFDPair!(Complex!float, TF_COMPLEX), TFDPair!(long, TF_INT64), TFDPair!(bool, TF_BOOL), TFDPair!(bfloat16, TF_BFLOAT16), TFDPair!(ushort, TF_UINT16), TFDPair!(Complex!double, TF_COMPLEX128), TFDPair!(half, TF_HALF), TFDPair!(uint, TF_UINT32), TFDPair!(ulong, TF_UINT64))
Undocumented in source.

Enums

tfType
eponymoustemplate tfType(T : type.D)
Undocumented in source.

Functions

empty
TF_Tensor* empty(long[N] dims)

Creates an uninitialized tensor with dtype of T.

makeTF_Tensor
TF_Tensor* makeTF_Tensor(long[N] dims, SourceRange source)

Creates a tensor from a given range.

makeTF_Tensor
TF_Tensor* makeTF_Tensor(Slice!(Iterator, N, kind) slice)

Creates a tensor from a given mir.ndslice.Slice

makeTF_Tensor
TF_Tensor* makeTF_Tensor(T scalar)

Creates a tensor from a given scalar.

tensor
Tensor tensor(Args args)

Allocates ref-counted (RC) Tensor. TODO(karita): non-allocated (borrowed) version.

tensor
Tensor tensor(TF_Tensor* t)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

TFDPair
struct TFDPair(_D, TF_DataType _tf)

Meta data to store TF/D types.

TensorOwner
struct TensorOwner

Tensor freed by dtor (RAII) with convinient methods.

Meta