package caisar
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=cd24b647565aaa4bb82d46c195c692d56ba0ad4b39bc86ef6baaf2d7a08c92a5
sha512=073761d95d6d8f6eb6f687643054297eb47db5d5bdc3a72ba42bf1509ab76415d485f536e5e42c11bd59c972ab7ad72e398d19af6e74c4f0778f28ef5bf4935e
doc/caisar.ir/Ir/Nier_cfg/Tensor/index.html
Module Nier_cfg.Tensor
Source
create sh
initialize a tensor with the given shape sh
with a default value, depending of the type of the tensor
type ('a, 'b) t_kind =
| K_int : (Base.int64, Bigarray.int64_elt) t_kind
| K_float : (Base.float, Bigarray.float64_elt) t_kind
get t idx
returns the value in tensor t
stored at coordinates idx
. Throw an error if the coordinate is invalid.
set_idx t idx v
sets value v
for tensor t
at idx
. Throw an error if the coordinate is invalid.
equal f t1 t2
applies f
to all values of t1
and t2
, and returns true if all applications of f returned true.
get_shape t
returns the shape of t
.
flatten t
returns a flattened version of t
.
num_neurons sh
returns the total number of neurons given a shape
get flatnd_idx idx sh flt
returns the value that would be stored at index idx
under a tensor of shape sh
, given the flattened version of this tensor flt
.
transpose_2d t
returns a copy of the tensor t
with its two last dimension exchanged.
unsqueeze sh1 sh2
returns the lowest common shape between sh1
and sh2
, and None if there is no common shape. A common shape is when a shape of higher dimension has only 1 coordinates on non-shared dimensions with the other.