예제 #1
0
 def convertible_rsub(x, y):
     return (x - y), torch.rsub(y, x)
예제 #2
0
 def forward(self, a, b):
     a1 = torch.add(a, b)
     b1 = torch.rsub(a, b)
     c1 = torch.sub(a, b)
     d1 = torch.mul(a, b)
     return a1, b1, c1, d1
예제 #3
0
파일: rsub_test.py 프로젝트: zhangnju/glow
 def test_f(a):
     return torch.rsub((a * a), 20)
예제 #4
0
 def forward(self, tensor, other):
     if other.size() == torch.Size([]):
         return torch.rsub((tensor * tensor), other.item())
     else:
         third = torch.rsub(tensor, other)
         return torch.rsub(third, third)
예제 #5
0
파일: rsub_test.py 프로젝트: zhangnju/glow
 def test_f(a, b):
     c = torch.rsub(a, b)
     return torch.rsub(c, c)