torch.nn.functional.hardtanh¶ torch.nn.functional.hardtanh(input, min_val=-1., max_val=1., inplace=False) → 张量[source][source]¶ 按元素应用 HardTanh 函数。有关更多详细信息,请参阅 Hardtanh。 返回类型 张量