From 539894d70ab53e3f5248d38a2a849d79801c64e9 Mon Sep 17 00:00:00 2001 From: Jerry Zhang Date: Fri, 25 Jan 2019 15:32:45 -0800 Subject: Remove caffe2::ShareData (#16139) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16139 Original commit changeset: 4b15a4c62995 Reviewed By: dzhulgakov Differential Revision: D13677464 fbshipit-source-id: 1a644a88fac02b44feebac48ccc01bc72cc47edb --- aten/src/ATen/test/tensor_interop_test.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'aten') diff --git a/aten/src/ATen/test/tensor_interop_test.cpp b/aten/src/ATen/test/tensor_interop_test.cpp index ec3886b306..f926312b5f 100644 --- a/aten/src/ATen/test/tensor_interop_test.cpp +++ b/aten/src/ATen/test/tensor_interop_test.cpp @@ -66,11 +66,11 @@ TEST(TestTensorInterop, PytorchToCaffe2Op) { auto* c2_tensor_a = BlobSetTensor(workspace.CreateBlob("a"), at_tensor_a.getIntrusivePtr()); auto* c2_tensor_b = BlobSetTensor(workspace.CreateBlob("b"), at_tensor_b.getIntrusivePtr()); - // Test ShareData as well + // Test Alias { - auto c2_tensor_c = XBlobGetMutableTensor(workspace.CreateBlob("c"), {0}, at::kCPU); - c2_tensor_c.ResizeLike(at_tensor_c.getIntrusivePtr()); - c2_tensor_c.ShareData(at_tensor_c.getIntrusivePtr()); + caffe2::Tensor c2_tensor_from_aten(at_tensor_c.getIntrusivePtr()); + BlobSetTensor(workspace.CreateBlob("c"), c2_tensor_from_aten.Alias()); + } { -- cgit v1.2.3