MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ContractionDims

Function ContractionDims

tensorflow/core/kernels/matmul_op_impl.h:67–69  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

65// operand is adjointed.
66// See http://en.wikipedia.org/wiki/Tensor_contraction
67Eigen::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.

Callers 3

RunMethod · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected