Ir.AssignmentsThe code for operating on n-dimensional arrays.
module Lazy = Utils.Lazymodule Tn = Tnodemodule Nd = Ndarraytype init_data = | Reshape of Ndarray.t| Keep_shape_no_padding of Ndarray.t| Padded of {data : Nd.t;padding : Ops.axis_padding Base.array;padded_value : Base.float;}val sexp_of_init_data : init_data -> Sexplib0.Sexp.tval sexp_of_buffer : buffer -> Sexplib0.Sexp.ttype fetch_op = | Constant of Base.float| Constant_bits of Base.int64Direct bit representation, primarily for uint4x32
*)| Constant_fill of Base.float Base.arrayFills in the numbers where the rightmost axis is contiguous. Primes shape inference to require the assigned tensor to have the same number of elements as the array, but in case of "leaky" shape inference, will loop over the values. This unrolls all assignments and should be used only for small arrays. Consider using Tnode.set_values instead for larger arrays.
| Range_over_offsetsFills in the offset number of each cell, i.e. how many cells away it is from the beginning, in the logical representation of the tensor node. (The actual in-memory positions in a buffer instantiating the node can differ.)
*)| Slice of {batch_idx : Indexing.static_symbol;sliced : Tn.t;}| Embed_symbol of Indexing.static_symbol| Embed_self_idEmbeds the id of the array field of the Fetch constructor.
| Embed_dim of Indexing.variable_refResets a array by performing the specified computation or data fetching.
val sexp_of_fetch_op : fetch_op -> Sexplib0.Sexp.tval sexp_of_accum_rhs : accum_rhs -> Sexplib0.Sexp.ttype t = | Noop| Seq of t * t| Block_comment of Base.string * tSame as the given code, with a comment.
*)| Accum_op of {initialize_neutral : Base.bool;accum : Ops.binop;lhs : Tn.t;rhs : accum_rhs;projections : Indexing.projections Lazy.t;projections_debug : Base.string;}| Set_vec_unop of {op : Ops.vec_unop;lhs : Tn.t;rhs : buffer;projections : Indexing.projections Lazy.t;projections_debug : Base.string;}| Fetch of {}val sexp_of_t : t -> Sexplib0.Sexp.tComputations based on assignments. Note: the arrayjit library makes use of, but does not produce nor verify the embedded_nodes associated to some given asgns.
val sexp_of_comp : comp -> Sexplib0.Sexp.tval empty_comp : compval is_total :
initialize_neutral:Base.bool ->
projections:Indexing.projections ->
Base.boolval can_skip_accumulation : projections:Indexing.projections -> boolReturns materialized nodes in the sense of Tnode.is_in_context_force. NOTE: it must be called after compilation; otherwise, it will disrupt memory mode inference.
In the second set, returns the nodes that are not read from after being written to. In the first set, returns the nodes that are ever read from.
val to_low_level : t -> Low_level.tval is_noop : t -> boolval to_doc :
?name:Base.String.t ->
?static_indices:Ir__Indexing.static_symbol Base.List.t ->
unit ->
t ->
PPrint.documentval to_string : t -> stringval get_name_exn : t -> Base.String.tval lower :
Low_level.optimize_ctx ->
unoptim_ll_source:(PPrint.document -> Base.unit) Base.option ->
ll_source:(PPrint.document -> Base.unit) Base.option ->
cd_source:(PPrint.document -> unit) option ->
name:Base.String.t ->
Indexing.static_symbol Base.List.t ->
t ->
Low_level.optimized