z = torch.full((3,4),-5)
print(z)
a = ~z
print(a)
print('')
import numpy
b = numpy.full((3,4),-5)
print(z)
a = ~z
print(a)
tensor([[-5, -5, -5, -5],
[-5, -5, -5, -5],
[-5, -5, -5, -5]])
tensor([[4, 4, 4, 4],
[4, 4, 4, 4],
[4, 4, 4, 4]])
tensor([[-5, -5, -5, -5],
[-5, -5, -5, -5],
[-5, -5, -5, -5]])
tensor([[4, 4, 4, 4],
[4, 4, 4, 4],
[4, 4, 4, 4]])
Process finished with exit code 0
总的来说,这玩意儿就是求相反数然后再减1。。。。。。。。。。。。。。。
应该是,,,,,科学吧。。。。。。