开发者
下载

InferShape4Broadcast

功能说明

broadcast类算子的infershape方法。

函数原型

ge::graphStatus InferShape4Broadcast(gert::InferShapeContext* context)

参数说明

参数名

输入/输出

说明

context

输入

GE传入的infershape上下文。

返回值说明

返回类型为ge::graphStatus:

  • ge::GRAPH_SUCCESS:infershape成功。
  • ge::GRAPH_FAIL:infershape失败。

约束说明

调用示例

关键代码示例如下,仅供参考,不支持直接拷贝运行。

1
2
3
4
5
6
7
8
// IsFinite算子进行inferShape推导,其推导过程与Broadcast算子推导过程一致,可直接复用
ge::graphStatus InferShape4IsFinite(gert::InferShapeContext* context) {

    return Ops::Base::InferShape4Broadcast(context);
}
// IsFinite算子及其推导函数注册到GE
IMPL_OP_INFERSHAPE(IsFinite).InferShape(InferShape4IsFinite);
}