Ir.Tnodemodule Lazy = Utils.Lazymodule Nd = Ndarraytype memory_mode = | Effectively_constantA constant, or a subset of Virtual.
| VirtualThe tensor node's computations are inlined on a per-scalar basis.
*)| Never_virtualOne of: Local, On_device, Materialized.
| LocalThe full tensor node is cached for the duration of a computation but not persisted across calls to compiled functions. It is not available for merging across devices.
*)| Device_onlyOne of: Local, On_device.
| On_deviceThe tensor node is stored on the devices that compute with it and persisted across function calls. It is available for merging across devices (for devices that support merging / P2P). CPU-side access (printing, persistence, inspection) is on-demand via context-mediated device-to-host transfers; no host copy is stored on the node.
*)| MaterializedAn as-yet-unresolved request for a persisted (non-virtual, non-local) node; resolves to On_device.
val memory_mode_of_sexp : Sexplib0.Sexp.t -> memory_modeval sexp_of_memory_mode : memory_mode -> Sexplib0.Sexp.tval compare_memory_mode : memory_mode -> memory_mode -> Base.intval equal_memory_mode : memory_mode -> memory_mode -> Base.boolval delayed_prec_of_sexp : Sexplib0.Sexp.t -> delayed_precval sexp_of_delayed_prec : delayed_prec -> Sexplib0.Sexp.tval equal_delayed_prec : delayed_prec -> delayed_prec -> Base.booltype t = {prec : Ops.prec Lazy.t;dims : Base.int Base.array Lazy.t;padding : (Ops.axis_padding Base.array * Base.float Base.option) Base.option
Lazy.t;If the tensor node is pre-padded, this is the pair of (left padding, right padding) per axis and the padding/neutral value. The inner float option is None when the tensor is used by operations with different neutral elements, requiring margin resets before each operation.
size_in_bytes : Base.int Lazy.t;id : Base.int;label : Base.string Base.list;Display information. It is better if the last element of the list is the most narrow or alphanumeric, e.g. an identifier.
*)mutable delayed_prec_unsafe : delayed_prec;mutable memory_mode : (memory_mode * Base.int) Base.option;mutable alias_of : (t * Indexing.static_symbol) Base.option;When Some (parent, batch_idx), this node is a zero-copy slice-alias *view* of parent: it owns no buffer of its own, and every read/write of it is redirected (during lowering) to parent with batch_idx prepended as the leading index. Set by Assignments.lower for alias-eligible Fetch.Slices; orthogonal to memory_mode. The strong reference to parent also keeps it reachable for as long as the alias is.
mutable slice_of : (t * Indexing.static_symbol) Base.option;When Some (parent, batch_idx), this node is an \@| sub-tensor slice of parent. Set *eagerly at construction* (independent of alias eligibility), so it is a superset of alias_of: every confirmed alias is a slice, but an ineligible slice (precision- converting, padded, virtual parent) is still a slice that falls back to a materializing copy. Used to reject direct host access (read/write the parent instead) -- including the window before lowering decides eligibility, where alias_of is still None.
mutable backend_info : Base.Sexp.t;mutable code_name : Base.string Base.option;}val sexp_of_t : t -> Sexplib0.Sexp.tval num_elems : t -> Base__Int.tval dims_without_padding : t -> Base.int Base.arrayval get_padding :
t ->
(Ops.axis_padding Base.array * Base.float Base.option) Base.optionval id : t -> Base.String.tval label : t -> Base.String.tval debug_name : t -> Base.String.tval debug_memory_mode : (memory_mode * Base.Int.t) option -> Base.String.tval log_debug_info : from_log_level:int -> t -> unitval default_to_most_local : t -> Base__Int.t -> unitDefaults to the most local memory mode compatible with the current setting.
val is_virtual_force : t -> Base.int -> boolval is_materialized_force : t -> Base__Int.t -> boolval is_alias : t -> boolA slice-alias view (see alias_of). Such a node owns no buffer of its own; its accesses are redirected to its parent during lowering.
val alias_of : t -> (t * Indexing.static_symbol) Base.optionval set_alias_of : t -> parent:t -> batch_idx:Indexing.static_symbol -> unitMarks tn as a zero-copy slice-alias view of parent with leading index batch_idx. Idempotent when re-marked with the same parent.
val is_slice : t -> boolval slice_of : t -> (t * Indexing.static_symbol) Base.optionval set_slice_of : t -> parent:t -> batch_idx:Indexing.static_symbol -> unitMarks tn as an \@| slice of parent eagerly at construction (before alias eligibility is known). Idempotent.
val is_in_context_force : t -> Base.int -> Base.boolval known_not_materialized : t -> boolval known_constant : t -> boolval known_non_virtual : t -> boolval known_virtual : t -> boolval mode_is_unspecified : t -> boolval update_memory_mode : t -> memory_mode -> Base.int -> unitinclude sig ... endval comparator : (t, comparator_witness) Base__Comparator.comparatorval 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_valuemodule Comp : sig ... endval sexp_of_t_set : (t, 'a) Base.Set.t -> Sexplib0.Sexp.ttype 'a t_map = (t, 'a, comparator_witness) Base.Map.tval sexp_of_t_map :
('a -> Sexplib0.Sexp.t) ->
(t, 'a, 'b) Base.Map.t ->
Sexplib0.Sexp.tval dims_to_string : ?with_axis_numbers:bool -> t -> Base.String.tval no_grad_ident_label : t -> bool * Base.String.t optionval styled_ident :
repeating_nograd_idents:(Base.String.t, 'a) Base.Hashtbl.t ->
repeating_grad_idents:(Base.String.t, 'a) Base.Hashtbl.t ->
[< `Heuristic_ocannl of [< `Dot_grad | `Under_grad ]
| `Name_and_label
| `Name_only ] ->
t ->
Base.String.tval update_code_name : t -> Base.string -> unitval header : t -> stringmodule Registry : sig ... endval registry : Registry.tval create :
delayed_prec ->
id:Base.int ->
label:Base.string Base.list ->
unpadded_dims:Base__Int.t Base.Array.t Lazy.t ->
padding:
(Ops.axis_padding Base.array * Base.float Base.option) Base.option Lazy.t ->
unit ->
tval create_from_padded :
id:Base.int ->
label:Base.string Base.list ->
ndarray:Nd.t ->
padding:(Ops.axis_padding Base.array * Base.float Base.option) Base.option ->
unit ->
t * Nd.t lazy_tval initial_default_prec : Ops.precval find : id:Base.int -> Registry.data optionHost-side value access (get_value, set_value, get_values, set_values, points_1d, points_2d) now lives in Context: it requires an explicit context and performs an on-demand device-to-host transfer. There is no host copy stored on the tensor node.
val print_accessible_headers :
?pred:(Registry.data -> bool) ->
unit ->
Base.unitval log_accessible_headers : ?pred:(Registry.data -> bool) -> unit -> unit