summaryrefslogtreecommitdiff
path: root/caffe2/utils
diff options
context:
space:
mode:
authorDmytro Dzhulgakov <dzhulgakov@fb.com>2018-10-30 10:19:36 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-10-30 10:25:40 -0700
commitec754adb14a38970db5834138980e3b795381e0b (patch)
treecae9379228971a6e6e6d7c76f6d593f6e4921faa /caffe2/utils
parent10de2c118796e2fac69514f9ea1bb3cabd502333 (diff)
downloadpytorch-ec754adb14a38970db5834138980e3b795381e0b.tar.gz
pytorch-ec754adb14a38970db5834138980e3b795381e0b.tar.bz2
pytorch-ec754adb14a38970db5834138980e3b795381e0b.zip
Kill more weird constructors on Tensor
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/13190 Reviewed By: ezyang Differential Revision: D12809293 fbshipit-source-id: 5eb663fe818276d97cf31d1ed1e7f025d2b69851
Diffstat (limited to 'caffe2/utils')
-rw-r--r--caffe2/utils/smart_tensor_printer_test.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/caffe2/utils/smart_tensor_printer_test.cc b/caffe2/utils/smart_tensor_printer_test.cc
index 651b6ad78a..a45573001c 100644
--- a/caffe2/utils/smart_tensor_printer_test.cc
+++ b/caffe2/utils/smart_tensor_printer_test.cc
@@ -28,12 +28,9 @@ void expect_stderr_contains(const std::vector<T>& values) {
template <typename T>
void printTensorAndCheck(const std::vector<T>& values) {
testing::internal::CaptureStderr();
- CPUContext cpuContext;
- Tensor tensor(
- std::vector<int64_t>{static_cast<int64_t>(values.size())},
- values,
- &cpuContext);
+ Tensor tensor =
+ TensorCPUFromValues<T>({static_cast<int64_t>(values.size())}, values);
SmartTensorPrinter::PrintTensor(tensor);
expect_stderr_contains(values);