beetlebug▾
/

ztcl::tensor dtype

Gives the dtype of a tensor.

ztcl::tensor dtype TENSOR

Description

Gives f32, f64, or i32.

Returns

A dtype.

Examples

Each example of this page runs after package require ztcl::tensor.

% ztcl::tensor dtype [ztcl::tensor ones 2 i32]
i32

Errors

% ztcl::tensor dtype {tensor q8 {} 1}
tensor: unknown dtype "q8": use f32, f64, or i32
-errorcode ZTCL TENSOR

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.4
Compute cost
A cost for each element operation by its kind (a copy, an add, a division, a math function, a multiply-add of a matmul), set so that one compute unit takes about the time of one unit of plain Tcl. docs/modules/tensor.md has the table.