From ee87254720338d64b950c594f18e0fb47e31d027 Mon Sep 17 00:00:00 2001 From: jainkunal3004 Date: Tue, 12 Mar 2019 12:50:29 -0700 Subject: [PATCH] Eliminate the use of Type. (#17804) Summary: Stack:     :black_circle:  **#17804 Eliminate the use of Type.**  [:yellow_heart:](https://our.intern.facebook.com/intern/diff/D14382165/) at::CPU produces Type object which is then casted into TensorOptions, instead directly using TensorOptions. Pull Request resolved: https://github.com/pytorch/pytorch/pull/17804 Differential Revision: D14407851 Pulled By: ezyang fbshipit-source-id: 6462d698305b7c24382c1bfd440d3227bd28d9e4 --- aten/src/ATen/ScalarOps.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aten/src/ATen/ScalarOps.h b/aten/src/ATen/ScalarOps.h index 70f6163..c74ed0c 100644 --- a/aten/src/ATen/ScalarOps.h +++ b/aten/src/ATen/ScalarOps.h @@ -10,10 +10,10 @@ namespace c10 { // to implement this without going through Derived Types (which are not part of core). inline at::Tensor scalar_to_tensor(Scalar s) { if (s.isFloatingPoint()) { - return at::scalar_tensor(s, at::CPU(kDouble).options()); + return at::scalar_tensor(s, at::device(at::kCPU).dtype(at::kDouble)); } else { AT_ASSERT(s.isIntegral()); - return at::scalar_tensor(s, at::CPU(kLong).options()); + return at::scalar_tensor(s, at::device(at::kCPU).dtype(at::kLong)); } } -- 2.7.4