def test_type_as():
torch.set_grad_enabled(False)
input_shape = [1, 3]
-
+
def _create_module(dtype):
class TypeAs(Module):
def forward(self, *args):
expected_type_tensor = torch.zeros(1, 3, dtype=dtype)
return args[0].type_as(expected_type_tensor)
-
+
return TypeAs()
input_data = torch.randn(input_shape).float()
except Exception as e:
# If GPU is not enabled in TVM, skip the fp16 test.
pass
-
+
+ # Temporary disable fp16 test
+ check_fp16 = False
+
if check_fp16:
verify_model(_create_module(torch.float16), input_data=input_data)