Shortcuts

torch.bitwise_not

torch.bitwise_not(input, *, out=None) 张量

计算给定输入张量的按位非。输入张量必须是整数或布尔类型。对于布尔张量,它计算逻辑非。

Parameters

输入 (张量) – 输入张量。

Keyword Arguments

输出 (张量, 可选) – 输出张量。

示例:

>>> torch.bitwise_not(torch.tensor([-1, -2, 3], dtype=torch.int8))
tensor([ 0,  1, -4], dtype=torch.int8)
优云智算