| 49 | } |
| 50 | |
| 51 | std::function<Maybe<void>(const std::string&)> MakeSetParamTensorDescFn(user_op::InferContext* ctx, |
| 52 | const Shape& shape) { |
| 53 | return [=](const std::string& bn) -> Maybe<void> { |
| 54 | if (ctx->has_output(bn, 0)) { |
| 55 | auto* tensor_desc = ctx->MutOutputTensorDesc(bn, 0); |
| 56 | CHECK_OR_RETURN(tensor_desc != nullptr); |
| 57 | tensor_desc->set_shape(shape); |
| 58 | } |
| 59 | return Maybe<void>::Ok(); |
| 60 | }; |
| 61 | } |
| 62 | |
| 63 | std::function<Maybe<void>(const std::string&)> MakeSetParamDataTypeFn(user_op::InferContext* ctx, |
| 64 | DataType data_type) { |
no test coverage detected