MCPcopy Create free account
hub / github.com/Oneflow-Inc/oneflow / MakeSetParamTensorDescFn

Function MakeSetParamTensorDescFn

oneflow/user/ops/normalization_op.cpp:51–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51std::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
63std::function<Maybe<void>(const std::string&)> MakeSetParamDataTypeFn(user_op::InferContext* ctx,
64 DataType data_type) {

Callers 2

MakeFwTensorDescInferFnFunction · 0.85
BwTensorDescInferFnFunction · 0.85

Calls 3

has_outputMethod · 0.45
MutOutputTensorDescMethod · 0.45
set_shapeMethod · 0.45

Tested by

no test coverage detected