|
|
|
@ -81,18 +81,18 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
|
|
|
|
|
"(int, default 1) "
|
|
|
|
|
R"DOC(The mul_op can take tensors with more than two dimensions as its
|
|
|
|
|
inputs. If the input `X` is a tensor with more than two
|
|
|
|
|
dimensions, `X` will be flatten into a two-dimensional matrix
|
|
|
|
|
first. The flatten rule is: the first `num_col_dims` will be
|
|
|
|
|
flatten to form the first dimension of the matrix (height of the
|
|
|
|
|
matrix), and the rest `rank(X) - num_col_dims` dimensions are
|
|
|
|
|
flattened to form the second dimension of the matrix (width of the
|
|
|
|
|
matrix). As a result, height of the flattened matrix is equal to
|
|
|
|
|
the product of `X`'s first `x_num_col_dims` dimensions' sizes,
|
|
|
|
|
and width of the flattened matrix is equal to the product of `X`'s
|
|
|
|
|
last `rank(x) - num_col_dims` dimensions' size.
|
|
|
|
|
For example, suppose `X` is a 6-dimensional tensor with the shape
|
|
|
|
|
[2, 3, 4, 5, 6], and `x_num_col_dims` = 3. Then, the flattened
|
|
|
|
|
matrix will have a shape [2 x 3 x 4, 5 x 6] = [24, 30].
|
|
|
|
|
dimensions, `X` will be flattened into a two-dimensional matrix
|
|
|
|
|
first. The flattening rule is: the first `num_col_dims` will be
|
|
|
|
|
flattened to form the first dimension of the final matrix (height
|
|
|
|
|
of the matrix), and the rest `rank(X) - num_col_dims` dimensions
|
|
|
|
|
are flattened to form the second dimension of the final matrix (
|
|
|
|
|
width of the matrix). As a result, height of the flattened matrix
|
|
|
|
|
is equal to the product of `X`'s first `x_num_col_dims` dimensions'
|
|
|
|
|
sizes, and width of the flattened matrix is equal to the product
|
|
|
|
|
of `X`'s last `rank(x) - num_col_dims` dimensions' size.
|
|
|
|
|
For example, suppose `X` is a 6-dimensional tensor with the shape
|
|
|
|
|
[2, 3, 4, 5, 6], and `x_num_col_dims` = 3. Then, the flattened
|
|
|
|
|
matrix will have a shape [2 x 3 x 4, 5 x 6] = [24, 30].
|
|
|
|
|
)DOC")
|
|
|
|
|
.SetDefault(1)
|
|
|
|
|
.EqualGreaterThan(1);
|
|
|
|
@ -102,14 +102,13 @@ class MulOpMaker : public framework::OpProtoAndCheckerMaker {
|
|
|
|
|
R"DOC(The mul_op can take tensors with more than two dimensions as its
|
|
|
|
|
inputs. If the input `Y` is a tensor with more than two
|
|
|
|
|
dimensions, `Y` will be flatten into a two-dimensional matrix
|
|
|
|
|
first. The attribute `y_num_col_dims` is used to flatten `Y` into
|
|
|
|
|
a two-dimensional matrix. See the comments of `x_num_col_dims` for
|
|
|
|
|
more details.
|
|
|
|
|
first. The attribute `y_num_col_dims` determines how `Y` is
|
|
|
|
|
flattened. See comments of `x_num_col_dims` for more details.
|
|
|
|
|
)DOC")
|
|
|
|
|
.SetDefault(1)
|
|
|
|
|
.EqualGreaterThan(1);
|
|
|
|
|
AddComment(R"DOC(
|
|
|
|
|
Mul Operator.
|
|
|
|
|
Mul Operator.
|
|
|
|
|
|
|
|
|
|
This operator is used to perform matrix multiplication for input X and Y.
|
|
|
|
|
|
|
|
|
|