Change to.dtype_layout to c10-full (#41169)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/41169

-
ghstack-source-id: 107537240

Test Plan: waitforsandcastle

Differential Revision: D22289257

fbshipit-source-id: ed3cc06327951fa886eb3b8f1c8bcc014ae2bc41
This commit is contained in:
Sebastian Messmer
2020-07-10 15:58:45 -07:00
committed by Facebook GitHub Bot
parent 7c143e5d3e
commit 9daba76ba1
10 changed files with 35 additions and 24 deletions
+8 -4
View File
@@ -99,8 +99,10 @@ TEST(TensorTest, ToOptionsWithRequiresGrad) {
// Throws if requires_grad is set in TensorOptions
ASSERT_THROW(
tensor.to(at::TensorOptions().requires_grad(true)), c10::Error);
ASSERT_THROW(
tensor.to(at::TensorOptions().requires_grad(false)), c10::Error);
// Doesn't throw if requires_grad is not set
tensor.to(at::TensorOptions());
tensor.to(at::TensorOptions().requires_grad(false));
}
{
auto tensor = torch::empty({3, 4});
@@ -113,8 +115,10 @@ TEST(TensorTest, ToOptionsWithRequiresGrad) {
// Throws if requires_grad is set in TensorOptions
ASSERT_THROW(
tensor.to(at::TensorOptions().requires_grad(true)), c10::Error);
ASSERT_THROW(
tensor.to(at::TensorOptions().requires_grad(false)), c10::Error);
// Doesn't throw if requires_grad is not set
tensor.to(at::TensorOptions());
tensor.to(at::TensorOptions().requires_grad(false));
}
}