[][src]Module ndarray_einsum_beta::validation

Contains functions and structs related to parsing an einsum-formatted string

This module has the implementation of Contraction and SizedContraction. SizedContraction is used throughout the library to store the details of a full contraction (corresponding to a string supplied by the caller) or a mini-contraction (corresponding to a simplification of a single tensor or a pairwise contraction between two tensors) produced by the optimizer in order to perform the full contraction.

Structs

Contraction

A Contraction contains the result of parsing an einsum-formatted string.

EinsumParse

The result of running an einsum-formatted string through the regex.

SizedContraction

A SizedContraction contains a Contraction as well as a HashMap<char, usize> specifying the axis lengths for each index in the contraction.

Traits

OutputSizeMethods

Functions

einsum_path

Create a SizedContraction, optimize the contraction order, and compile the result into an EinsumPath.

get_operand_shapes
parse_einsum_string

Runs an input string through a regex and convert it to an EinsumParse.

validate

Wrapper around Contraction::new().

validate_and_optimize_order

Create a SizedContraction and then optimize the order in which pairs of inputs will be contracted.

validate_and_size

Wrapper around SizedContraction::new().

Type Definitions

OutputSize