mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
Remove is_variable from tests (#56305)
Summary: `is_variable` spits out a deprecation warning during the build (if it's still something that needs to be tested we can ignore deprecated warnings for the whole test instead of this change). Pull Request resolved: https://github.com/pytorch/pytorch/pull/56305 Pulled By: driazati Reviewed By: ezyang Differential Revision: D27834218 fbshipit-source-id: c7bbea7e9d8099bac232a3a732a27e4cd7c7b950
This commit is contained in:
committed by
Facebook GitHub Bot
parent
eacf6f1b51
commit
4e0760f41a
@@ -424,7 +424,6 @@ void test_TorchTensorCtorSingleDimFloatingType_expected_dtype(c10::ScalarType de
|
||||
ASSERT_TRUE(almost_equal(tensor[2], 3.125));
|
||||
|
||||
tensor = torch::tensor({1.5f, 2.25f, 3.125f});
|
||||
ASSERT_TRUE(tensor.is_variable());
|
||||
ASSERT_EQ(tensor.numel(), 3);
|
||||
ASSERT_EQ(tensor.sizes(), std::vector<int64_t>({3}));
|
||||
ASSERT_EQ(tensor.dtype(), default_dtype);
|
||||
@@ -433,7 +432,6 @@ void test_TorchTensorCtorSingleDimFloatingType_expected_dtype(c10::ScalarType de
|
||||
ASSERT_TRUE(almost_equal(tensor[2], 3.125f));
|
||||
|
||||
tensor = torch::tensor(at::ArrayRef<float>({1.5f, 2.25f, 3.125f}));
|
||||
ASSERT_TRUE(tensor.is_variable());
|
||||
ASSERT_EQ(tensor.numel(), 3);
|
||||
ASSERT_EQ(tensor.dtype(), default_dtype);
|
||||
ASSERT_TRUE(almost_equal(tensor[0], 1.5));
|
||||
@@ -441,7 +439,6 @@ void test_TorchTensorCtorSingleDimFloatingType_expected_dtype(c10::ScalarType de
|
||||
ASSERT_TRUE(almost_equal(tensor[2], 3.125));
|
||||
|
||||
tensor = torch::tensor(std::vector<float>({1.5f, 2.25f, 3.125f}));
|
||||
ASSERT_TRUE(tensor.is_variable());
|
||||
ASSERT_EQ(tensor.numel(), 3);
|
||||
ASSERT_EQ(tensor.sizes(), std::vector<int64_t>({3}));
|
||||
ASSERT_EQ(tensor.dtype(), default_dtype);
|
||||
|
||||
Reference in New Issue
Block a user