def add_shape(self: ascendie.Network, arg0: ascendie.Tensor) -> ascendie.ShapeLayer
函数功能
在网络中添加一个ShapeLayer,用来获取输入tensor的shape,shapeLayer的输出tensor是一个1维的int类型的tensor。
函数原型
add_shape(self: ascendie.Network, arg0: ascendie.Tensor) -> ascendie.ShapeLayer
约束说明
- input维度需在[0, 8]。
- 当前不支持动态shape。
参数说明
参数名 |
参数类型 |
输入/输出 |
说明 |
---|---|---|---|
input |
Tensor |
输入 |
ShapeLayer的输入张量。 |