package caisar

  1. Overview
  2. Docs

Module Nir.GentensorSource

Sourcetype t =
  1. | Float of (float, Stdlib.Bigarray.float64_elt) Tensor.t
  2. | Int8 of (int, Stdlib.Bigarray.int8_signed_elt) Tensor.t
  3. | UInt8 of (int, Stdlib.Bigarray.int8_unsigned_elt) Tensor.t
  4. | Int32 of (int32, Stdlib.Bigarray.int32_elt) Tensor.t
  5. | Int64 of (int64, Stdlib.Bigarray.int64_elt) Tensor.t
Sourceval create_1_float : float -> t
Sourceval create_1_int64 : int64 -> t
Sourceval create_const_float : Shape.t -> float -> t

create_const_float shape v returns a tensor of shape shape where each value is initialized to v.

Sourceval of_float_array : ?shape:Shape.t -> float array -> t

of_float_array a shape returns a Tensor with data contained in l and shape shape. If no shape is given, the resulting tensor shape is 1-dimensional, equals to the length of l.

Sourceval of_int64_array : ?shape:Shape.t -> int64 array -> t

of_int64_array a shape returns a Tensor with data contained in l and shape shape. If no shape is given, the resulting tensor shape is 1-dimensional, equals to the length of l.

Sourceval of_float_matrix : ?trans:bool -> float array array -> t

of_float_matrix trans m returns a Tensor with data contained in m. If trans is true (default: false), then m is transposed, i.e., if m had shape (n,k), then the result will have shape (k,n).

Sourceval of_reversed_float_matrix : float array array -> t

of_float_matrix m returns a Tensor with data contained in m but in reversed shape. In other words, if m had shape (n,k), then the result has shape (k,n).

Sourceval shape : t -> Shape.t
OCaml

Innovation. Community. Security.