Module Einsum_parser.AxisKey

An index pointing to any of a shape's axes, including the kind of the axis (Batch, Input, Output) and the position (which is counted from the end to facilitate broadcasting).

Note the following inconsistency due to differing conventions in function notation and matrix notation: for label specifications and einsum notation, we write "batch|inputs->outputs", but when we convert a shape to an Ndarray index we do it in the order [batch; outputs; inputs].

module T : sig ... end
include module type of struct include T end
type kind = [
  1. | `Batch
  2. | `Input
  3. | `Output
]
val equal_kind : kind -> kind -> Base.bool
val compare_kind : kind -> kind -> Base.int
val __kind_of_sexp__ : Sexplib0.Sexp.t -> kind
val kind_of_sexp : Sexplib0.Sexp.t -> kind
val sexp_of_kind : kind -> Sexplib0.Sexp.t
val hash_fold_kind : Ppx_hash_lib.Std.Hash.state -> kind -> Ppx_hash_lib.Std.Hash.state
val hash_kind : kind -> Ppx_hash_lib.Std.Hash.hash_value
type t = T.t = {
  1. in_axes : kind;
  2. pos : Base.int;
    (*

    Indices start at 1 (note this is axis index, dimension indices are always 0-based), counted from the end if from_end is true.

    *)
  3. from_end : Base.bool;
    (*

    Axes are indexed from the front (rarely) or from the end (typically), to avoid reindexing when broadcasting.

    *)
}
val equal : t -> t -> Base.bool
val compare : t -> t -> Base.int
val t_of_sexp : Sexplib0.Sexp.t -> t
val sexp_of_t : t -> Sexplib0.Sexp.t
include sig ... end
type comparator_witness = Base__Comparator.Make(T).comparator_witness
val comparator : (T.t, comparator_witness) Base__Comparator.comparator