package caisar
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=a9a704f1e4e255eee2e9b0333e6c7b0e3e002293ce0068faa1c3d7c18d209997
sha512=7e35bd5527f82c5c6f62452c88e2971907a4eab89fd4efb699b99eb95f730d752908d51c47e104dcff5ceb58cf24c87d3399cb42e09a47691440927463168abb
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.