package nx

  1. Overview
  2. Docs

Module Nx_core.Make_frontendSource

Parameters

module B : Backend_intf.S

Signature

Sourcemodule B = B
Sourcetype ('a, 'b) t = ('a, 'b) B.t
Sourcetype context = B.context
Sourcetype float16_elt = Bigarray.float16_elt
Sourcetype float32_elt = Bigarray.float32_elt
Sourcetype float64_elt = Bigarray.float64_elt
Sourcetype int32_elt = Bigarray.int32_elt
Sourcetype int64_elt = Bigarray.int64_elt
Sourcetype int_elt = Bigarray.int_elt
Sourcetype nativeint_elt = Bigarray.nativeint_elt
Sourcetype complex32_elt = Bigarray.complex32_elt
Sourcetype complex64_elt = Bigarray.complex64_elt
Sourcetype ('a, 'b) dtype = ('a, 'b) Dtype.t =
  1. | Float16 : (float, float16_elt) dtype
  2. | Float32 : (float, float32_elt) dtype
  3. | Float64 : (float, float64_elt) dtype
  4. | Int8 : (int, int8_elt) dtype
  5. | UInt8 : (int, uint8_elt) dtype
  6. | Int16 : (int, int16_elt) dtype
  7. | UInt16 : (int, uint16_elt) dtype
  8. | Int32 : (int32, int32_elt) dtype
  9. | Int64 : (int64, int64_elt) dtype
  10. | Int : (int, int_elt) dtype
  11. | NativeInt : (nativeint, nativeint_elt) dtype
  12. | Complex32 : (Complex.t, complex32_elt) dtype
  13. | Complex64 : (Complex.t, complex64_elt) dtype
Sourcetype float16_t = (float, float16_elt) t
Sourcetype float32_t = (float, float32_elt) t
Sourcetype float64_t = (float, float64_elt) t
Sourcetype int8_t = (int, int8_elt) t
Sourcetype uint8_t = (int, uint8_elt) t
Sourcetype int16_t = (int, int16_elt) t
Sourcetype uint16_t = (int, uint16_elt) t
Sourcetype int32_t = (int32, int32_elt) t
Sourcetype int64_t = (int64, int64_elt) t
Sourcetype std_int_t = (int, int_elt) t
Sourcetype std_nativeint_t = (nativeint, nativeint_elt) t
Sourcetype complex32_t = (Complex.t, complex32_elt) t
Sourcetype complex64_t = (Complex.t, complex64_elt) t
Sourceval float16 : (float, float16_elt) dtype
Sourceval float32 : (float, float32_elt) dtype
Sourceval float64 : (float, float64_elt) dtype
Sourceval int8 : (int, int8_elt) dtype
Sourceval uint8 : (int, uint8_elt) dtype
Sourceval int16 : (int, int16_elt) dtype
Sourceval uint16 : (int, uint16_elt) dtype
Sourceval int32 : (int32, int32_elt) dtype
Sourceval int64 : (int64, int64_elt) dtype
Sourceval int : (int, int_elt) dtype
Sourceval nativeint : (nativeint, nativeint_elt) dtype
Sourcetype index =
  1. | I of int
  2. | L of int list
  3. | R of int list
Sourceval unsafe_data : ('a, 'b) B.t -> ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t
Sourceval shape : ('a, 'b) B.t -> Shape.t
Sourceval dtype : ('a, 'b) B.t -> ('a, 'b) Dtype.t
Sourceval strides : ('a, 'b) B.t -> int array
Sourceval stride : int -> ('a, 'b) B.t -> int
Sourceval dims : ('a, 'b) B.t -> Shape.t
Sourceval dim : int -> ('a, 'b) B.t -> int
Sourceval ndim : ('a, 'b) B.t -> int
Sourceval itemsize : ('a, 'b) B.t -> int
Sourceval size : ('a, 'b) B.t -> int
Sourceval numel : ('a, 'b) B.t -> int
Sourceval nbytes : ('a, 'b) B.t -> int
Sourceval offset : ('a, 'b) B.t -> int
Sourceval is_c_contiguous : ('a, 'b) B.t -> bool
Sourceval power_of_two : 'a 'b. ('a, 'b) Dtype.t -> int -> 'a
Sourceval array_prod : int array -> int
Sourceval ceildiv : int -> int -> int

Integer ceiling division: (a + b - 1) / b for integers a, b where b > 0.

Sourceval ensure_float_dtype : string -> ('a, 'b) B.t -> unit
Sourceval ensure_int_dtype : string -> ('a, 'b) B.t -> unit
Sourceval pair_to_array : ('a * 'a) -> 'a array
Sourceval resolve_axis : ?ndim_opt:int -> ('a, 'b) B.t -> int option -> int array
Sourceval resolve_single_axis : ?ndim_opt:int -> ('a, 'b) B.t -> int -> int
Sourceval reshape : int array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval broadcast_to : Shape.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval broadcasted : ?reverse:bool -> ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t * ('a, 'b) B.t
Sourceval expand : int array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval cast : ('c, 'd) Dtype.t -> ('a, 'b) t -> ('c, 'd) t
Sourceval astype : ('a, 'b) Dtype.t -> ('c, 'd) t -> ('a, 'b) t
Sourceval contiguous : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval copy : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval blit : ('a, 'b) B.t -> ('a, 'b) B.t -> unit
Sourceval create : B.context -> ('a, 'b) Dtype.t -> int array -> 'a array -> ('a, 'b) B.t
Sourceval init : B.context -> ('a, 'b) Dtype.t -> int array -> (int array -> 'a) -> ('a, 'b) B.t
Sourceval scalar : B.context -> ('a, 'b) Dtype.t -> 'a -> ('a, 'b) B.t
Sourceval empty : B.context -> ('a, 'b) Dtype.t -> int array -> ('a, 'b) B.t
Sourceval full : B.context -> ('a, 'b) Dtype.t -> int array -> 'a -> ('a, 'b) B.t
Sourceval zeros : B.context -> ('a, 'b) Dtype.t -> int array -> ('a, 'b) B.t
Sourceval ones : B.context -> ('a, 'b) Dtype.t -> int array -> ('a, 'b) B.t
Sourceval scalar_like : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval create_like : ('a, 'b) B.t -> (B.context -> ('a, 'b) Dtype.t -> Shape.t -> 'c) -> 'c
Sourceval empty_like : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval full_like : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval zeros_like : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval ones_like : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval fill : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval unsafe_to_bigarray : ('a, 'b) B.t -> ('a, 'b, Bigarray.c_layout) Bigarray.Genarray.t
Sourceval of_bigarray : B.context -> ('a, 'b, Bigarray.c_layout) Bigarray.Genarray.t -> ('a, 'b) B.t
Sourceval unsafe_to_array : ('a, 'b) B.t -> 'a array
Sourceval binop : (('a, 'b) B.t -> ('a, 'b) B.t -> 'c) -> ('a, 'b) B.t -> ('a, 'b) B.t -> 'c
Sourceval scalar_op : (('a, 'b) B.t -> ('a, 'b) B.t -> 'c) -> ('a, 'b) B.t -> 'a -> 'c
Sourceval scalar_binop : (('a, 'b) B.t -> ('a, 'b) B.t -> 'c) -> ('a, 'b) B.t -> 'a -> 'c
Sourceval reverse_scalar_op : (('a, 'b) B.t -> ('a, 'b) B.t -> 'c) -> 'a -> ('a, 'b) B.t -> 'c
Sourceval inplace_op : (('a, 'b) B.t -> ('c, 'd) B.t -> ('a, 'b) B.t) -> ('a, 'b) B.t -> ('c, 'd) B.t -> ('a, 'b) B.t
Sourceval inplace_scalar_op : (('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t) -> ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval add : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval add_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval iadd : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval radd_s : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval iadd_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval sub : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval sub_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval rsub_s : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval isub : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval isub_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval mul : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval mul_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval rmul_s : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval imul : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval imul_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval div : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval div_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval rdiv_s : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval idiv : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval idiv_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval pow : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval pow_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval rpow_s : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval ipow : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval ipow_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval maximum : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval maximum_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval rmaximum_s : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval imaximum : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval imaximum_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval minimum : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval minimum_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval rminimum_s : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval iminimum : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval iminimum_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval mod_ : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval mod_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval rmod_s : 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval imod : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval imod_s : ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval bitwise_xor : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval bitwise_or : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval bitwise_and : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval logical_and : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval logical_or : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval logical_xor : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval logical_not : ('a, 'b) t -> ('a, 'b) B.t
Sourceval cmplt : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval less : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval cmpne : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval not_equal : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval cmpeq : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval equal : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval cmpgt : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval greater : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval cmple : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval less_equal : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval cmpge : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval greater_equal : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval neg : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval bitwise_not : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval invert : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval log2 : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval exp2 : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval sin : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval sqrt : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval recip : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval log : (float, 'a) B.t -> (float, 'a) B.t
Sourceval exp : (float, 'a) B.t -> (float, 'a) B.t
Sourceval cos : (float, 'a) B.t -> (float, 'a) B.t
Sourceval tan : (float, 'a) B.t -> (float, 'a) B.t
Sourceval square : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval abs : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval sign : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval relu : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval sigmoid : (float, 'a) B.t -> (float, 'a) B.t
Sourceval rsqrt : ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval poly_n_horner_coeffs_first : ('a, 'b) B.t -> 'a list -> ('a, 'b) B.t
Sourceval asin : (float, 'a) B.t -> (float, 'a) B.t
Sourceval acos : (float, 'a) B.t -> (float, 'a) B.t
Sourceval atan : (float, 'a) B.t -> (float, 'a) B.t
Sourceval sinh : (float, 'a) B.t -> (float, 'a) B.t
Sourceval cosh : (float, 'a) B.t -> (float, 'a) B.t
Sourceval tanh : (float, 'a) B.t -> (float, 'a) B.t
Sourceval asinh : (float, 'a) B.t -> (float, 'a) B.t
Sourceval acosh : (float, 'a) B.t -> (float, 'a) B.t
Sourceval atanh : (float, 'a) B.t -> (float, 'a) B.t
Sourceval trunc : ('a, 'b) B.t -> ('a, 'b) t
Sourceval ceil : (float, 'a) B.t -> (float, 'a) B.t
Sourceval floor : (float, 'a) B.t -> (float, 'a) B.t
Sourceval round : (float, 'a) B.t -> (float, 'a) B.t
Sourceval isinf : (float, 'a) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval isnan : ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval isfinite : (float, 'a) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval lerp : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval lerp_scalar_weight : ('a, 'b) B.t -> ('a, 'b) B.t -> 'a -> ('a, 'b) B.t
Sourceval lshift : ('a, 'b) B.t -> int -> ('a, 'b) B.t
Sourceval rshift : ('a, 'b) B.t -> int -> ('a, 'b) B.t
Sourceval clamp : ?min:'a -> ?max:'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval clip : ?min:'a -> ?max:'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval where : (int, Dtype.uint8_elt) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval atan2 : (float, 'a) B.t -> (float, 'a) B.t -> (float, 'a) B.t
Sourceval hypot : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval reduce_op : (axes:int array -> keepdims:bool -> ('a, 'b) B.t -> 'c) -> ?axes:int array -> ?keepdims:bool -> ('a, 'b) B.t -> 'c
Sourceval sum : ?axes:int array -> ?keepdims:bool -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval max : ?axes:int array -> ?keepdims:bool -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval min : ?axes:int array -> ?keepdims:bool -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval prod : ?axes:int array -> ?keepdims:bool -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval mean : ?axes:int array -> ?keepdims:bool -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval var : ?axes:int array -> ?keepdims:bool -> ?ddof:int -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval std : ?axes:int array -> ?keepdims:bool -> ?ddof:int -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval all : ?axes:int array -> ?keepdims:bool -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval any : ?axes:int array -> ?keepdims:bool -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval array_equal : ('a, 'b) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t
Sourceval pad : (int * int) array -> 'a -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval shrink : (int * int) array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval flatten : ?start_dim:int -> ?end_dim:int -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval unflatten : int -> int array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval ravel : ('a, 'b) B.t -> ('a, 'b) B.t
Sourcemodule IntSet : sig ... end
Sourceval squeeze : ?axes:IntSet.elt array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval unsqueeze : ?axes:IntSet.elt array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval squeeze_axis : IntSet.elt -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval unsqueeze_axis : IntSet.elt -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval expand_dims : IntSet.elt array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval transpose : ?axes:int array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval flip : ?axes:int array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval moveaxis : int -> int -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval swapaxes : int -> int -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval roll : ?axis:int -> int -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval tile : int array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval repeat : ?axis:int -> int -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval concatenate : ?axis:int -> ('a, 'b) B.t list -> ('a, 'b) B.t
Sourceval stack : ?axis:IntSet.elt -> ('a, 'b) B.t list -> ('a, 'b) B.t
Sourceval ensure_ndim : int -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval vstack : ('a, 'b) B.t list -> ('a, 'b) B.t
Sourceval hstack : ('a, 'b) B.t list -> ('a, 'b) B.t
Sourceval dstack : ('a, 'b) B.t list -> ('a, 'b) B.t
Sourceval broadcast_arrays : ('a, 'b) B.t list -> ('a, 'b) B.t list
Sourceval eye : B.context -> ?m:int -> ?k:int -> ('a, 'b) Dtype.t -> int -> ('a, 'b) B.t
Sourceval identity : B.context -> ('a, 'b) Dtype.t -> int -> ('a, 'b) B.t
Sourceval arange : B.context -> ('a, 'b) Dtype.t -> int -> int -> int -> ('a, 'b) B.t
Sourceval arange_f : B.context -> (float, 'a) Dtype.t -> float -> float -> float -> (float, 'a) B.t
Sourceval linspace : B.context -> ('a, 'b) Dtype.t -> ?endpoint:bool -> float -> float -> int -> ('a, 'b) B.t
Sourceval logspace : B.context -> (float, 'a) Dtype.t -> ?endpoint:bool -> ?base:float -> float -> float -> int -> (float, 'a) B.t
Sourceval geomspace : B.context -> (float, 'a) Dtype.t -> ?endpoint:bool -> float -> float -> int -> (float, 'a) B.t
Sourceval meshgrid : ?indexing:[< `ij | `xy xy ] -> ('a, 'b) B.t -> ('c, 'd) B.t -> ('a, 'b) B.t * ('c, 'd) B.t
Sourceval normalize_index : int -> int -> int
Sourceval expand_range_spec : int -> int list -> int * int * int
Sourceval indices_of_spec : int -> index -> int list
Sourceval slice : index list -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval set_slice : index list -> ('a, 'b) B.t -> ('a, 'b) B.t -> unit
Sourceval slice_ranges : ?steps:int list -> int list -> int list -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval set_slice_ranges : ?steps:int list -> int list -> int list -> ('a, 'b) B.t -> ('a, 'b) B.t -> unit
Sourceval get : int list -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval set : int list -> ('a, 'b) B.t -> ('a, 'b) B.t -> unit
Sourceval unsafe_get : int list -> ('a, 'b) B.t -> 'a
Sourceval unsafe_set : int list -> 'a -> ('a, 'b) B.t -> unit
Sourceval array_split : axis:int -> [< `Count of int | `Indices of int list ] -> ('a, 'b) B.t -> ('a, 'b) B.t list
Sourceval split : axis:int -> int -> ('a, 'b) B.t -> ('a, 'b) B.t list
Sourceval validate_random_params : string -> ('a, 'b) Dtype.t -> int array -> unit
Sourceval rand : B.context -> ('a, 'b) Dtype.t -> ?seed:int -> int array -> ('a, 'b) B.t
Sourceval randn : B.context -> ('a, 'b) Dtype.t -> ?seed:int -> int array -> ('a, 'b) B.t
Sourceval randint : B.context -> ('a, 'b) Dtype.t -> ?seed:int -> ?high:int -> int array -> int -> ('a, 'b) B.t
Sourceval sort : ?descending:bool -> ?axis:int -> ('a, 'b) t -> ('a, 'b) t * (int32, Dtype.int32_elt) B.t
Sourceval argsort : ?descending:bool -> ?axis:int -> ('a, 'b) t -> (int32, Dtype.int32_elt) B.t
Sourceval argmax : ?axis:int -> ?keepdims:bool -> ('a, 'b) B.t -> (int32, Dtype.int32_elt) B.t
Sourceval argmin : ?axis:int -> ?keepdims:bool -> ('a, 'b) t -> (int32, Dtype.int32_elt) t
Sourceval dot : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval matmul : ('a, 'b) B.t -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval relu6 : (float, 'a) B.t -> (float, 'a) B.t
Sourceval hard_sigmoid : ?alpha:float -> ?beta:float -> (float, 'a) B.t -> (float, 'a) B.t
Sourceval softplus : (float, 'a) B.t -> (float, 'a) B.t
Sourceval silu : (float, 'a) B.t -> (float, 'a) B.t
Sourceval hard_silu : (float, 'a) B.t -> (float, 'a) B.t
Sourceval log_sigmoid : (float, 'a) B.t -> (float, 'a) B.t
Sourceval leaky_relu : ?negative_slope:float -> (float, 'a) B.t -> (float, 'a) B.t
Sourceval hard_tanh : (float, 'a) B.t -> (float, 'a) B.t
Sourceval elu : ?alpha:float -> (float, 'a) B.t -> (float, 'a) B.t
Sourceval selu : (float, 'a) B.t -> (float, 'a) B.t
Sourceval softmax : ?axes:int array -> (float, 'a) B.t -> (float, 'a) B.t
Sourceval gelu_approx : (float, 'a) B.t -> (float, 'a) B.t
Sourceval softsign : (float, 'a) B.t -> (float, 'a) B.t
Sourceval mish : (float, 'a) B.t -> (float, 'a) B.t
Sourceval im2col : kernel_size:int array -> stride:int array -> dilation:int array -> padding:(int * int) array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval col2im : output_size:int array -> kernel_size:int array -> stride:int array -> dilation:int array -> padding:(int * int) array -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval calculate_padding_for_mode : int array -> k_s:int array -> s_s:int array -> d_s:int array -> mode:[< `Full | `Same | `Valid ] -> op_type:[ `Convolution | `Correlation ] -> (int * int) array
Sourceval correlate_nd_general : groups:int -> int array -> padding_mode:[< `Full | `Same | `Valid ] -> int array -> ?fillvalue:'a -> int -> ?bias:('b, 'c) B.t -> op_type:[ `Convolution | `Correlation ] -> ('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t
Sourceval correlate_nd : ?groups:int -> int array -> ?padding_mode:[ `Full | `Same | `Valid ] -> int array -> ?fillvalue:'a -> int -> ?bias:('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t
Sourceval correlate1d : ?groups:int -> ?stride:int -> ?padding_mode:[ `Full | `Same | `Valid ] -> ?dilation:int -> ?fillvalue:'a -> ?bias:('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t

Correlate1D (cross-correlation). x: input tensor (bs, cin_total, iw) w: weight tensor (cout, cin_per_group, kw) bias: optional bias tensor (cout) stride, dilation: integers for the spatial dimension. padding_mode: `Full | `Valid | `Same fillvalue: optional scalar to fill padding. Defaults to 0 of x's dtype.

Sourceval correlate2d : ?groups:int -> ?stride:(int * int) -> ?padding_mode:[ `Full | `Same | `Valid ] -> ?dilation:(int * int) -> ?fillvalue:'a -> ?bias:('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t

Correlate2D (cross-correlation). x: input tensor (bs, cin_total, ih, iw) w: weight tensor (cout, cin_per_group, kh, kw) bias: optional bias tensor (cout) stride, dilation: (int*int) tuples for (h,w) spatial dimensions. padding_mode: `Full | `Valid | `Same fillvalue: optional scalar to fill padding. Defaults to 0 of x's dtype.

Sourceval convolve_nd : ?groups:int -> int array -> ?padding_mode:[< `Full | `Same | `Valid Valid ] -> int array -> ?fillvalue:'a -> int -> ?bias:('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t

ConvolveND - Generic N-Dimensional version. This flips the kernel (weights) along all its spatial dimensions then calls correlate_nd.

Sourceval convolve1d : ?groups:int -> ?stride:int -> ?padding_mode:[< `Full | `Same | `Valid Valid ] -> ?dilation:int -> ?fillvalue:'a -> ?bias:('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t

Convolve1D. x: input tensor (bs, cin_total, iw) w: weight tensor (cout, cin_per_group, kw)

Sourceval convolve2d : ?groups:int -> ?stride:(int * int) -> ?padding_mode:[< `Full | `Same | `Valid Valid ] -> ?dilation:(int * int) -> ?fillvalue:'a -> ?bias:('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t -> ('b, 'c) B.t

Convolve2D. x: input tensor (bs, cin_total, ih, iw) w: weight tensor (cout, cin_per_group, kh, kw)

Sourceval resolve_padding_for_ops : [< `Full | `Same | `Valid ] -> input_spatial_shape:int array -> k_s:int array -> s_s:int array -> d_s:int array -> op_type:[ `Convolution | `Correlation ] -> (int * int) array

Helper to resolve padding specification for pooling/convolution operations. Input `padding_spec` is user-facing. Output `(int*int) array` is for `B.op_pad`, (pad_before, pad_after) for each spatial dimension.

Sourceval apply_ceil_mode : current_pads_pairs:(int * int) array -> input_spatial_shape:int array -> k_s:int array -> s_s:int array -> d_s:int array -> (int * int) array

Helper to adjust padding for ceil_mode=true. Analogous to tinygrad's _apply_ceil_mode. Input `current_pads_pairs` is (pad_before, pad_after) for each spatial dim. Output is new (pad_before, pad_after) array for each spatial dim.

Sourceval pool_setup : num_spatial_dims:int -> kernel_size:int array -> ?stride:int array -> ?dilation:int array -> padding_spec:[< `Full | `Same | `Valid ] -> ceil_mode:bool -> ('a, 'b) B.t -> int array * int array * int array * (int * int) array * (int * int) array * (int * int) array
Sourceval avg_pool_nd : kernel_size:int array -> ?stride:int array -> ?dilation:int array -> padding_spec:[< `Full | `Same | `Valid ] -> ceil_mode:bool -> count_include_pad:bool -> num_spatial_dims:int -> (float, 'a) B.t -> (float, 'a) B.t
Sourceval max_pool_nd : kernel_size:int array -> ?stride:int array -> ?dilation:int array -> padding_spec:[< `Full | `Same | `Valid ] -> ceil_mode:bool -> return_indices:bool -> num_spatial_dims:int -> ('a, 'b) B.t -> ('a, 'b) B.t * (int32, Dtype.int32_elt) B.t option
Sourceval avg_pool1d : kernel_size:int -> ?stride:int -> ?dilation:int -> ?padding_spec:[< `Full | `Same | `Valid Valid ] -> ?ceil_mode:bool -> ?count_include_pad:bool -> (float, 'a) B.t -> (float, 'a) B.t
Sourceval avg_pool2d : kernel_size:(int * int) -> ?stride:(int * int) -> ?dilation:(int * int) -> ?padding_spec:[< `Full | `Same | `Valid Valid ] -> ?ceil_mode:bool -> ?count_include_pad:bool -> (float, 'a) B.t -> (float, 'a) B.t
Sourceval max_pool1d : kernel_size:int -> ?stride:int -> ?dilation:int -> ?padding_spec:[< `Full | `Same | `Valid Valid ] -> ?ceil_mode:bool -> ?return_indices:bool -> ('a, 'b) B.t -> ('a, 'b) B.t * (int32, Dtype.int32_elt) B.t option
Sourceval max_pool2d : kernel_size:(int * int) -> ?stride:(int * int) -> ?dilation:(int * int) -> ?padding_spec:[< `Full | `Same | `Valid Valid ] -> ?ceil_mode:bool -> ?return_indices:bool -> ('a, 'b) B.t -> ('a, 'b) B.t * (int32, Dtype.int32_elt) B.t option
Sourceval min_pool_nd : kernel_size:int array -> ?stride:int array -> ?dilation:int array -> padding_spec:[< `Full | `Same | `Valid ] -> ceil_mode:bool -> return_indices:bool -> num_spatial_dims:int -> ('a, 'b) B.t -> ('a, 'b) B.t * (int32, Dtype.int32_elt) B.t option

Internal N-Dimensional min pooling using unfold and reduce.

Sourceval min_pool1d : kernel_size:int -> ?stride:int -> ?dilation:int -> ?padding_spec:[< `Full | `Same | `Valid Valid ] -> ?ceil_mode:bool -> ?return_indices:bool -> ('a, 'b) B.t -> ('a, 'b) B.t * (int32, Dtype.int32_elt) B.t option
Sourceval min_pool2d : kernel_size:(int * int) -> ?stride:(int * int) -> ?dilation:(int * int) -> ?padding_spec:[< `Full | `Same | `Valid Valid ] -> ?ceil_mode:bool -> ?return_indices:bool -> ('a, 'b) B.t -> ('a, 'b) B.t * (int32, Dtype.int32_elt) B.t option
Sourceval one_hot : num_classes:int -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t

Helper for N-dim one-hot encoding. Creates a new last dimension for classes.

Sourceval max_unpool_nd : kernel_size:int array -> ?stride:int array -> ?dilation:int array -> padding_spec:[< `Full | `Same | `Valid ] -> ?output_size_opt:int array -> num_spatial_dims:int -> (int, Dtype.uint8_elt) B.t -> ('a, 'b) B.t -> (int, Dtype.uint8_elt) B.t

Internal N-Dimensional max unpooling.

Sourceval max_unpool1d : (int, Dtype.uint8_elt) B.t -> ('a, 'b) B.t -> kernel_size:int -> ?stride:int -> ?dilation:int -> ?padding_spec:[< `Full | `Same | `Valid Valid ] -> ?output_size_opt:int array -> unit -> (int, Dtype.uint8_elt) B.t
Sourceval max_unpool2d : (int, Dtype.uint8_elt) B.t -> ('a, 'b) B.t -> kernel_size:(int * int) -> ?stride:(int * int) -> ?dilation:(int * int) -> ?padding_spec:[< `Full | `Same | `Valid Valid ] -> ?output_size_opt:int array -> unit -> (int, Dtype.uint8_elt) B.t
Sourceval pp_data : Format.formatter -> ('a, 'b) t -> unit
Sourceval format_to_string : (Format.formatter -> 'a -> 'b) -> 'a -> string
Sourceval print_with_formatter : (Format.formatter -> 'a -> 'b) -> 'a -> unit
Sourceval data_to_string : ('a, 'b) t -> string
Sourceval print_data : ('a, 'b) t -> unit
Sourceval pp_dtype : Format.formatter -> ('a, 'b) Dtype.t -> unit
Sourceval dtype_to_string : ('a, 'b) Dtype.t -> string
Sourceval shape_to_string : int array -> string
Sourceval pp_shape : Format.formatter -> int array -> unit
Sourceval pp : Format.formatter -> ('a, 'b) B.t -> unit
Sourceval print : ('a, 'b) B.t -> unit
Sourceval to_string : ('a, 'b) B.t -> string
Sourceval unsafe_map : ('a -> 'a) -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval unsafe_iter : ('a -> 'b) -> ('a, 'c) B.t -> unit
Sourceval unsafe_fold : ('a -> 'b -> 'a) -> 'a -> ('b, 'c) B.t -> 'a
Sourceval map : (('a, 'b) B.t -> ('a, 'b) B.t) -> ('a, 'b) B.t -> ('a, 'b) B.t
Sourceval iter : (('a, 'b) B.t -> 'c) -> ('a, 'b) B.t -> unit
Sourceval fold : ('a -> ('b, 'c) B.t -> 'a) -> 'a -> ('b, 'c) B.t -> 'a
OCaml

Innovation. Community. Security.