torch_npu.fast_gelu(self) -> Tensor
计算输入张量中fast_gelu的梯度。
self (Tensor) - 数据类型:float16、float32。
>>> x = torch.rand(2).npu() >>> x tensor([0.5991, 0.4094], device='npu:0') >>> torch_npu.fast_gelu(x) tensor([0.4403, 0.2733], device='npu:0')