예제 #1
0
 def propagate(self, *args):
     with FakeTensorMode.push() as mode:
         fake_args = [mode.from_tensor(a) for a in args]
         return super().run(*fake_args)
예제 #2
0
 def propagate(self, *args):
     self.multi_output_view_nodes = {}
     self.node_counter = -1
     with FakeTensorMode.push() as mode:
         fake_args = [mode.from_tensor(a) for a in args]
         return super().run(*fake_args)
예제 #3
0
 def test_normalize_device(self):
     with FakeTensorMode.push():
         x = torch.empty(1, device="cuda")
         y = torch.empty(1, device=f"cuda:{torch.cuda.current_device()}")
         out = x + y
     self.checkType(out, "cuda", [1])