Ir.Ndarraymodule Lazy = Utils.LazyN-dimensional arrays: a precision-handling wrapper for Bigarray.Genarray and its utilities.
val bigarray_start_not_managed : ('ocaml, 'elt_t) bigarray -> Ctypes_ptr.voidpval big_ptr_to_string : ('a, 'b) bigarray -> Base.String.tval sexp_of_bigarray : ('a, 'b) bigarray -> Base.Sexp.ttype byte_nd = (Base.char, Ops.uint8_elt) bigarraytype uint16_nd = (Base.int, Ops.uint16_elt) bigarraytype int32_nd = (Base.int32, Ops.int32_elt) bigarraytype uint32_nd = (Base.int32, Ops.int32_elt) bigarraytype int64_nd = (Base.int64, Ops.int64_elt) bigarraytype uint64_nd = (Base.int64, Ops.int64_elt) bigarraytype uint4x32_nd = (Stdlib.Complex.t, Stdlib.Bigarray.complex64_elt) bigarraytype half_nd = (Base.float, Ops.float16_elt) bigarraytype bfloat16_nd = (Base.int, Ops.uint16_elt) bigarraytype fp8_nd = (Base.char, Ops.uint8_elt) bigarraytype single_nd = (Base.float, Ops.float32_elt) bigarraytype double_nd = (Base.float, Ops.float64_elt) bigarrayval sexp_of_byte_nd : byte_nd -> Base.Sexp.tval sexp_of_uint16_nd : uint16_nd -> Base.Sexp.tval sexp_of_int32_nd : int32_nd -> Base.Sexp.tval sexp_of_uint32_nd : uint32_nd -> Base.Sexp.tval sexp_of_int64_nd : int64_nd -> Base.Sexp.tval sexp_of_uint64_nd : uint64_nd -> Base.Sexp.tval sexp_of_uint4x32_nd : uint4x32_nd -> Base.Sexp.tval sexp_of_half_nd : half_nd -> Base.Sexp.tval sexp_of_bfloat16_nd : bfloat16_nd -> Base.Sexp.tval sexp_of_fp8_nd : fp8_nd -> Base.Sexp.tval sexp_of_single_nd : single_nd -> Base.Sexp.tval sexp_of_double_nd : double_nd -> Base.Sexp.tval sexp_of_t : t -> Sexplib0.Sexp.tval as_array : ('ocaml, 'elt_t) Ops.precision -> ('ocaml, 'elt_t) bigarray -> tval precision_to_bigarray_kind :
('ocaml, 'elt_t) Ops.precision ->
('ocaml, 'elt_t) Stdlib.Bigarray.kindval precision_string : t -> stringval default_kind : (Base.float, Ops.float32_elt) Ops.precisiontype 'r apply_with_prec = {f : 'ocaml 'elt_t. ('ocaml, 'elt_t) Ops.precision ->
('ocaml, 'elt_t) bigarray ->
'r;}val apply_with_prec : 'a apply_with_prec -> t -> 'aval create_bigarray_of_prec :
('ocaml, 'elt_t) Ops.precision ->
int array ->
('ocaml, 'elt_t) bigarrayval create_bigarray :
('ocaml, 'elt_t) Ops.precision ->
dims:int array ->
padding:('a * float) option ->
('ocaml, 'elt_t) bigarrayval apply : 'a apply_as_bigarray -> t -> 'aval apply2 : 'a apply2_as_bigarray -> t -> t -> 'aval dims : t -> int arrayval get_fatptr_not_managed :
t ->
('a option, unit Ctypes_static.typ) Ctypes_memory.Fat.tval get_voidptr_not_managed : t -> Base.unit Ctypes.ptrval adjust_idx_for_padding :
?padding:Ops.axis_padding Base.Array.t ->
Base__Int.t Base.Array.t ->
Base__Int.t Base.Array.tHelper function to adjust indices by adding left padding when padding is specified
val compute_end_idx :
?padding:Ops.axis_padding Base.Array.t ->
Base__Int.t Base.Array.t ->
int ->
Base__Int.tHelper function to compute end index for iteration, respecting padding margins
val set_from_float :
?padding:Ops.axis_padding Base.Array.t ->
t ->
Base__Int.t Base.Array.t ->
Base.float ->
unitval fill_from_float : t -> Base.float -> unitval fold_bigarray :
?padding:Ops.axis_padding Base.Array.t ->
('a, 'b, 'c) A.t ->
init:'d ->
f:('d -> Base__Int.t Base.Array.t -> 'a -> 'd) ->
'dval fold_as_float :
?padding:Ops.axis_padding Base.Array.t ->
init:'a ->
f:('a -> Base__Int.t Base.Array.t -> Base.float -> 'a) ->
t ->
'aval size_in_bytes : t -> intval get_as_float :
?padding:Ops.axis_padding Base.Array.t ->
t ->
Base__Int.t Base.Array.t ->
Base.Float.tval retrieve_2d_points :
?from_axis:Base__Int.t ->
?padding:Ops.axis_padding Base.Array.t ->
xdim:int ->
ydim:int ->
t ->
(Base.Float.t * Base.Float.t) Base.Array.tval retrieve_1d_points :
?from_axis:Base__Int.t ->
?padding:Ops.axis_padding Base.Array.t ->
xdim:int ->
t ->
Base.Float.t Base.Array.tval retrieve_flat_values :
?padding:Ops.axis_padding Base.Array.t ->
t ->
Base.Float.t Base.Array.tval set_flat_values :
?padding:Ops.axis_padding Base.Array.t ->
t ->
Base.float Base.Array.t ->
unitval c_ptr_to_string : t -> Base.String.tval ptr_to_string_hum : t -> Base.String.tval to_native : t -> Ctypes_ptr.voidpval hash : t -> Base__Ppx_hash_lib.Std.Hash.hash_valueval hash_fold_t :
Base__.Ppx_hash_lib.Std.Hash.state ->
t ->
Base__.Ppx_hash_lib.Std.Hash.stateval hash_t : t -> Base__Ppx_hash_lib.Std.Hash.hash_valueval copy_with_padding :
source:t ->
target:t ->
padding:Ops.axis_padding Base.array ->
Base.unitCopies the whole of source onto the parts of target skipping over padding margins -- requires that source dimensions + padding = target dimensions.
val init_array :
debug:Base.string ->
Ops.prec ->
dims:Base.int Base.array ->
padding:(Ops.axis_padding Base.Array.t * float) option ->
f:(Base.int Base.array -> Base.float) ->
tInitializes an array using a function from indices to values. Note: dims must include padding if padding is specified, but the callback f indices operate in the before-padding space.
This function is slow as it performs unboxing at each index. Generate and wrap a bigarray if efficiency is a concern.
val int_dims_to_string :
?with_axis_numbers:bool ->
?padding:Ops.axis_padding Base.Array.t ->
Base.Int.t Base.Array.t ->
Base.String.tDimensions to string, "x"-separated, e.g. 1x2x3 for batch dims 1, input dims 3, output dims 2. Outputs "-" for empty dimensions.
val log_debug_info : from_log_level:int -> t -> unitLogs information about the array on the default ppx_minidebug runtime, if from_log_level > Utlis.settings.with_log_level.
val render_array :
?brief:Base.bool ->
?prefix:Base.String.t ->
?entries_per_axis:Base__Int.t ->
?labels:Base.String.t Base.Array.t ->
indices:Base__Int.t Base.Array.t ->
t ->
PrintBox.tPrints 0-based indices entries out of arr, where a number between -5 and -1 in an axis means to print out the axis, and a non-negative number means to print out only the indexed dimension of the axis. Prints up to entries_per_axis or entries_per_axis+1 entries per axis, possibly with ellipsis in the middle. labels provides the axis labels for all axes (use "" or "_" for no label). The last label corresponds to axis -1 etc. The printed out axes are arranged as:
-1: a horizontal segment in an inner rectangle (i.e. column numbers of the inner rectangle),-2: a sequence of segments in a line of text (i.e. column numbers of an outer rectangle),-3: a vertical segment in an inner rectangle (i.e. row numbers of the inner rectangle),-4: a vertical sequence of segments (i.e. column numbers of an outer rectangle),-5: a sequence of screens of text (i.e. stack numbers of outer rectangles).val to_doc :
?prefix:Base.String.t ->
?entries_per_axis:Base__Int.t ->
?labels:Base.String.t Base.Array.t ->
indices:Base__Int.t Base.Array.t ->
t ->
PPrint.documentval to_doc_inline :
num_batch_axes:Base__Int.t ->
num_output_axes:Base__Int.t ->
num_input_axes:Base__Int.t ->
?axes_spec:string ->
t ->
PPrint.documentPrints the whole array in an inline syntax.