ABACUS develop
Atomic-orbital Based Ab-initio Computation at UStc
|
Classes | |
struct | BCast |
Enumerations | |
enum | EinsumDimensionType { kBroadcasting = 0 , kBatch = 1 , kFree = 2 , kContract = 3 , kReduce = 4 } |
Functions | |
bool | ValidateEinsumEquation (const std::string &equation, std::vector< std::string > &input_subscripts, std::string &output_subscript) |
Check the validation of the input equations. | |
bool | ParseEinsumEquation (const std::string &equation, std::vector< EinsumDimensionType > &label_types, std::vector< std::vector< int > > &input_labels, std::vector< int > &output_labels, std::vector< std::vector< int > > &input_label_counts, std::vector< int > &output_label_counts, std::vector< bool > &input_has_ellipsis, bool &output_has_ellipsis) |
bool | RecordLabelToDimension (const int label, const int axis, const Tensor &input, std::unordered_map< int, int64_t > &label_to_dim_sizes) |
bool | ProcessDimensions (const std::vector< const Tensor * > &inputs, std::vector< EinsumDimensionType > &label_types, std::vector< std::vector< int > > &input_labels, std::vector< int > &output_labels, std::vector< std::vector< int > > &input_label_counts, std::vector< int > &output_label_counts, const std::vector< bool > &input_has_ellipsis, const bool output_has_ellipsis, std::unordered_map< int, int64_t > &label_to_dim_sizes) |
bool | ReduceOperand (const Tensor &input, const std::vector< EinsumDimensionType > &label_types, std::vector< int > &labels, const std::vector< int > &label_counts, std::vector< int > &free_labels, int &swap_free_and_contract, Tensor &output) |
bool | ContractOperands (std::vector< Tensor > &inputs, const std::vector< int > &swap_free_and_contract, const EinsumOption &option, Tensor &output) |
A function to perform contraction operation on multiple Tensors. | |
void | ProcessOutput (const Tensor &input, const std::vector< einsum_utils::EinsumDimensionType > &label_types, const std::vector< std::vector< int > > &free_labels, std::unordered_map< int, int64_t > &label_to_dim_sizes, const std::vector< int > &output_labels, const std::vector< int > &output_label_counts, Tensor &output) |
Variables | |
constexpr int | kEllipsisLabel = -1 |
bool container::einsum_utils::ContractOperands | ( | std::vector< Tensor > & | inputs, |
const std::vector< int > & | swap_free_and_contract, | ||
const EinsumOption & | option, | ||
Tensor & | output | ||
) |
A function to perform contraction operation on multiple Tensors.
This functor applies a contraction operation on multiple input Tensors and computes the result. The contraction operation combines the input Tensors based on a specific contraction pattern to produce a single output Tensor. The contraction pattern is defined by the swap_free_and_contract
vector, which specifies whether each input Tensor should be contracted or simply copied to the output.
bool container::einsum_utils::ParseEinsumEquation | ( | const std::string & | equation, |
std::vector< EinsumDimensionType > & | label_types, | ||
std::vector< std::vector< int > > & | input_labels, | ||
std::vector< int > & | output_labels, | ||
std::vector< std::vector< int > > & | input_label_counts, | ||
std::vector< int > & | output_label_counts, | ||
std::vector< bool > & | input_has_ellipsis, | ||
bool & | output_has_ellipsis | ||
) |
bool container::einsum_utils::ProcessDimensions | ( | const std::vector< const Tensor * > & | inputs, |
std::vector< EinsumDimensionType > & | label_types, | ||
std::vector< std::vector< int > > & | input_labels, | ||
std::vector< int > & | output_labels, | ||
std::vector< std::vector< int > > & | input_label_counts, | ||
std::vector< int > & | output_label_counts, | ||
const std::vector< bool > & | input_has_ellipsis, | ||
const bool | output_has_ellipsis, | ||
std::unordered_map< int, int64_t > & | label_to_dim_sizes | ||
) |
void container::einsum_utils::ProcessOutput | ( | const Tensor & | input, |
const std::vector< einsum_utils::EinsumDimensionType > & | label_types, | ||
const std::vector< std::vector< int > > & | free_labels, | ||
std::unordered_map< int, int64_t > & | label_to_dim_sizes, | ||
const std::vector< int > & | output_labels, | ||
const std::vector< int > & | output_label_counts, | ||
Tensor & | output | ||
) |
bool container::einsum_utils::RecordLabelToDimension | ( | const int | label, |
const int | axis, | ||
const Tensor & | input, | ||
std::unordered_map< int, int64_t > & | label_to_dim_sizes | ||
) |
bool container::einsum_utils::ReduceOperand | ( | const Tensor & | input, |
const std::vector< EinsumDimensionType > & | label_types, | ||
std::vector< int > & | labels, | ||
const std::vector< int > & | label_counts, | ||
std::vector< int > & | free_labels, | ||
int & | swap_free_and_contract, | ||
Tensor & | output | ||
) |
bool container::einsum_utils::ValidateEinsumEquation | ( | const std::string & | equation, |
std::vector< std::string > & | input_subscripts, | ||
std::string & | output_subscript | ||
) |
Check the validation of the input equations.
|
constexpr |