mul op dims error
Created by: wanghaoshuang
When i run infershape function of fc layer, i got mul op dims error:
paddle.v2.fluid.core.EnforceNotMet: enforce y_dims.size() > y_num_col_dims failed, 1 <= 1
The input tensor Y's rank of MulOp should be larger than y_num_col_dims. at [/home/work/Paddle/paddle/operators/mul_op.cc:47]
and with debug log:
I1123 12:59:49.114255 28049 mul_op.cc:36] mul operator x.shape=1, 10 y.shape=0 x_num_col_dims=1 y_num_col_dims=1
And i print the protobuf about mul op in my net as bellow:
blocks {
idx: 0
parent_idx: -1
vars {
name: "fc2.w_0"
type: LOD_TENSOR
lod_tensor {
tensor {
data_type: FP32
dims: 10
dims: 4
}
}
persistable: true
}
vars {
name: "fc1.w_0"
type: LOD_TENSOR
lod_tensor {
tensor {
data_type: FP32
dims: 10
dims: 10
}
}
persistable: true
}
...
ops {
inputs {
parameter: "X"
arguments: "obs"
}
inputs {
parameter: "Y"
arguments: "fc1.w_0"
}
outputs {
parameter: "Out"
arguments: "fc1.tmp_0"
}
type: "mul"
attrs {
name: "y_num_col_dims"
type: INT
i: 1
}
attrs {
name: "x_num_col_dims"
type: INT
i: 1
}
}
ops {
inputs {
parameter: "X"
arguments: "fc1.tmp_0"
}
ops {
inputs {
parameter: "X"
arguments: "fc1.tmp_2"
}
inputs {
parameter: "Y"
arguments: "fc2.w_0"
}
outputs {
parameter: "Out"
arguments: "fc2.tmp_0"
}
type: "mul"
attrs {
name: "y_num_col_dims"
type: INT
i: 1
}
attrs {
name: "x_num_col_dims"
type: INT
i: 1
}
}
...
}