@@ -986,7 +986,6 @@ def test_cat_cpu(self):
986
986
def test_cat_cuda (self ):
987
987
self ._test_cat ('cuda' )
988
988
989
- @unittest .skip ("temporarily disable" )
990
989
def test_scalar (self ):
991
990
@torch .jit .script
992
991
def test_float (x , y , z , a , b ):
@@ -1010,23 +1009,22 @@ def test_int(x, y, z, a, b):
1010
1009
# FIXME: interp.elapsed_value() also increments due to simplifier
1011
1010
assert llvm .elapsed_value () == 1 or interp .elapsed_value () > 1
1012
1011
1013
- # FIXME: Blocked on profiling executor changes
1014
- # def test_loop():
1015
- # @torch.jit.script
1016
- # def test(x, y, z):
1017
- # # type: (Tensor, Tensor, int) -> Tensor
1018
- # b = y
1019
- # for i in range(0, z):
1020
- # a = x + y
1021
- # b = b + y
1022
- # return b
1023
- #
1024
- # llvm = LLVMCodeGenExecuted()
1025
- # interp = SimpleIREvalExecuted()
1026
- # x, y, z = (torch.zeros(32, 32), torch.ones(32, 32), 4)
1027
- # test(x, y, z)
1028
- # r = test(x, y, z)
1029
- # assert llvm.elapsed_value == 1 or interp.elapsed_value() > 1
1012
+ def test_loop (self ):
1013
+ @torch .jit .script
1014
+ def test (x , y , z ):
1015
+ # type: (Tensor, Tensor, int) -> Tensor
1016
+ b = y
1017
+ for i in range (0 , z ):
1018
+ a = x + y
1019
+ b = b + y
1020
+ return b
1021
+
1022
+ llvm = LLVMCodeGenExecuted ()
1023
+ interp = SimpleIREvalExecuted ()
1024
+ x , y , z = (torch .zeros (32 , 32 ), torch .ones (32 , 32 ), 4 )
1025
+ test (x , y , z )
1026
+ r = test (x , y , z )
1027
+ assert llvm .elapsed_value == 1 or interp .elapsed_value () > 1
1030
1028
1031
1029
@unittest .skip ("no shape inference for aten::slice yet" )
1032
1030
def test_slice (self ):
@@ -1195,19 +1193,6 @@ def run_where(x, y):
1195
1193
y = run_where (a , b )
1196
1194
np .testing .assert_allclose (x .numpy (), y .numpy ())
1197
1195
1198
- @unittest .skipIf (not torch .cuda .is_available (), "requires CUDA" )
1199
- @unittest .skip ("temporarily disable" )
1200
- def test_unused (self ):
1201
- def test (x , y ):
1202
- return x * x + torch .rand_like (y )
1203
- a = torch .rand (1 , device = "cuda" )
1204
- b = torch .rand (1 , device = "cuda" )
1205
- scripted = torch .jit .script (test )
1206
- scripted (a , b )
1207
- cx = CudaCodeGenExecuted ()
1208
- scripted (a , b )
1209
- assert cx .elapsed_value () == 0
1210
-
1211
1196
@unittest .skipIf (not torch .cuda .is_available (), "requires CUDA" )
1212
1197
def test_multi_rand (self ):
1213
1198
def test (x ):
0 commit comments