Returns the pair of dimensions along which to perform Tensor contraction to emulate matrix multiplication. For matrix multiplication of 2D Tensors X and Y, X is contracted along second dimension and Y is contracted along the first dimension (if neither X nor Y is adjointed). The dimension to contract along is switched when any operand is adjointed. See http://en.wikipedia.org/wiki/Tensor_contracti
| 65 | // operand is adjointed. |
| 66 | // See http://en.wikipedia.org/wiki/Tensor_contraction |
| 67 | Eigen::IndexPair<Eigen::DenseIndex> ContractionDims(bool adj_x, bool adj_y) { |
| 68 | return Eigen::IndexPair<Eigen::DenseIndex>(adj_x ? 0 : 1, adj_y ? 1 : 0); |
| 69 | } |
| 70 | |
| 71 | // Parallel batch matmul kernel based on the multi-threaded tensor contraction |
| 72 | // in Eigen. |