未验证 提交 72e235d0 编写于 作者: Y Yuanle Liu 提交者: GitHub

tensor should be defined (#53449)

上级 6f5a4dfe
......@@ -1151,10 +1151,15 @@ bool AnalysisPredictor::SetFeed(const std::vector<paddle::Tensor> &inputs,
feeds_.size(),
inputs.size()));
for (size_t i = 0; i < inputs.size(); ++i) {
PADDLE_ENFORCE_EQ(inputs[i].initialized(),
PADDLE_ENFORCE_EQ(inputs[i].defined(),
true,
paddle::platform::errors::InvalidArgument(
"The input Tensor expected to be initialized."));
"The input Tensor expected to be defined."));
PADDLE_ENFORCE_EQ(
inputs[i].is_dense_tensor(),
true,
paddle::platform::errors::InvalidArgument(
"The input Tensor expected to be type of dense tensor."));
}
if (std::all_of(inputs.cbegin(), inputs.cend(), [&](const paddle::Tensor &t) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册