def add_input(self: Network, name: str, type: DataType, dim: Dims) -> Tensor
函数功能
向网络添加输入张量。
函数原型
add_input(self: ascendie.pyascendie.Network, arg0: str, arg1: ascendie.pyascendie.DataType, arg2: ascendie.pyascendie.Dims) -> ascendie.pyascendie.Tensor
约束说明
- name必须为合法字符串,不能为空字符串,不能重复添加与之前相同的name,不能包含“\n”,“\f”,“\r”, "\v", "\t","\b","\u007f", " " 等转义字符,字符长度为:1~128。
- dim不可为空,且当前版本只支持添加静态的输入,即input的每一个维度都大于0。
- 当前不支持动态shape。
参数说明
参数名 |
参数类型 |
输入/输出 |
说明 |
---|---|---|---|
name |
string |
输入 |
张量的名称。 |
type |
DataType |
输入 |
张量中保存的数据类型。 |
dim |
Dims |
输入 |
张量的维度。 |