File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,8 @@ class SamplingIdOp : public framework::OperatorWithKernel {
30
30
" Output(Out) of SamplingIdOp should not be null." );
31
31
32
32
auto input_dims = ctx->GetInputDim (" X" );
33
+ PADDLE_ENFORCE (input_dims.size () == 2 ,
34
+ " Input(X, Filter) should be 2-D tensor." );
33
35
34
36
framework::DDim dims = input_dims;
35
37
ctx->SetOutputDim (" Out" , dims);
@@ -46,10 +48,8 @@ class SamplingIdOpMaker : public framework::OpProtoAndCheckerMaker {
46
48
AddOutput (" Out" , " SamplingId data tensor." );
47
49
AddComment (R"DOC(
48
50
SamplingId Operator.
49
- @brief A layer for sampling id from multinomial distribution from the
50
- input layer. Sampling one id for one sample. The result is stored in
51
- output_.ids.
52
- )DOC" );
51
+ A layer for sampling id from multinomial distribution from the
52
+ input layer. Sampling one id for one sample.)DOC" );
53
53
}
54
54
};
55
55
} // namespace operators
You can’t perform that action at this time.
0 commit comments