-  3.39.23
Public Attributes | List of all members
matfaust::FaustMulMode Class Reference

Enumeration class of all matrix chain multiplication methods available to multiply a Faust to a matrix or to compute Faust.full(). These methods are used by Faust.optimize_time(). More...

Public Attributes

Constant Property DEFAULT_L2R =0
 The default method, it computes the product from the right to the left. More...
 
Constant Property DYNPROG =5
 This method implements the classic dynamic programming solution of the chain matrix problem. More...
 
Constant Property TORCH_CPU_L2R =8
 This method computes the product of the matrix chain from the left to the right using the Torch C++ library (CPU backend). More...
 
Constant Property TORCH_CPU_GREEDY =9
 
Constant Property TORCH_CPU_DENSE_DYNPROG_SPARSE_L2R =10
 The same as TORCH_CPU_L2R except that torch::chain_matmul is used to compute in one call the intermediary product of dense contiguous factors, then the result is multiplied by sparse factors if any remains. More...
 

Detailed Description

Enumeration class of all matrix chain multiplication methods available to multiply a Faust to a matrix or to compute Faust.full(). These methods are used by Faust.optimize_time().

Member Data Documentation

◆ DEFAULT_L2R

Constant Property matfaust::FaustMulMode::DEFAULT_L2R =0

The default method, it computes the product from the right to the left.

◆ DYNPROG

Constant Property matfaust::FaustMulMode::DYNPROG =5

This method implements the classic dynamic programming solution of the chain matrix problem.

See https://en.wikipedia.org/wiki/Matrix_chain_multiplication#A_dynamic_programming_algorithm. Note that the standard method is extended in order to take into account the complexity of multiplications including a sparse matrix (because that's not the same cost than multiplying dense matrices).

◆ TORCH_CPU_DENSE_DYNPROG_SPARSE_L2R

Constant Property matfaust::FaustMulMode::TORCH_CPU_DENSE_DYNPROG_SPARSE_L2R =10

The same as TORCH_CPU_L2R except that torch::chain_matmul is used to compute in one call the intermediary product of dense contiguous factors, then the result is multiplied by sparse factors if any remains.

torch::chain_matmul follows the dynamic programming principle as DYNPROG method does (but the former handles only dense matrices).

References: https://pytorch.org/cppdocs/api/function_namespaceat_1aee491a9ff453b6033b4106516bc61a9d.html?highlight=chain_matmul https://pytorch.org/docs/stable/generated/torch.chain_matmul.html?highlight=chain_matmul#torch.chain_matmul This method is only available for the specific packages pyfaust_torch.

◆ TORCH_CPU_GREEDY

Constant Property matfaust::FaustMulMode::TORCH_CPU_GREEDY =9

The computational cost depends on the matrix dimensions and the number of nonzeros (when a matrix is in sparse format).

This method is only available for the specific packages pyfaust_torch.

◆ TORCH_CPU_L2R

Constant Property matfaust::FaustMulMode::TORCH_CPU_L2R =8

This method computes the product of the matrix chain from the left to the right using the Torch C++ library (CPU backend).

This method is only available for the specific packages pyfaust_torch.


The documentation for this class was generated from the following file: