GetDynamicInputShape

函数功能

获取算子IR原型定义中类型为“DYNAMIC_INPUT”的输入shape的指针,即动态输入的shape指针,shape中包含了原始shape与运行时shape。

函数原型

const StorageShape *GetDynamicInputShape(const size_t ir_index, const size_t relative_index) const;

参数说明

参数

输入/输出

说明

ir_index

输入

动态输入在算子IR原型定义中的索引,从0开始计数。

relative_index

输入

该输入实例化后的相对index,例如某个DYNAMIC_INPUT实例化了3个输入,那么relative_index的取值范围是[0,2]。

返回值说明

指定的输入shape指针,当输入index或relative_index非法时,返回空指针。

关于StorageShape类型的定义,请参见StorageShape结构体

约束说明

调用示例

ge::graphStatus InferShape4ConcatD(TilingContext* context) {
  auto in_shape = context->GetDynamicInputShape(dynamic_input_idx, 0);
  ...
}