ClipLayer *AddClip(Tensor *input, float min, float max) noexcept;
函数功能
在网络中添加一个ClipLayer,用于将输入中的每一个元素取值限制在[min, max]的范围内。
函数原型
ClipLayer *AddClip(Tensor *input, float min, float max) noexcept;
约束说明
input维度需在[0, 8]。
参数说明
参数名 |
输入/输出 |
说明 |
---|---|---|
input |
输入 |
ClipLayer的输入张量。 |
min |
输入 |
目标范围的最小值。 |
max |
输入 |
目标范围的最大值。 |
返回值说明
返回一个ClipLayer,如果添加失败则返回nullptr或抛出异常。
父主题: class Network