summaryrefslogtreecommitdiff
path: root/caffe2/opt
diff options
context:
space:
mode:
authorSebastian Messmer <messmer@fb.com>2018-09-25 11:26:48 -0700
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>2018-09-25 11:40:24 -0700
commit8f0db9bbbb84632b1bf6c89e0949964f36e4588b (patch)
tree5bdaa8b2f346da85077610653c1e3d2c8920bd22 /caffe2/opt
parent94c513cc7f27d98ec6b5dead0af7fabcf5c5cd13 (diff)
downloadpytorch-8f0db9bbbb84632b1bf6c89e0949964f36e4588b.tar.gz
pytorch-8f0db9bbbb84632b1bf6c89e0949964f36e4588b.tar.bz2
pytorch-8f0db9bbbb84632b1bf6c89e0949964f36e4588b.zip
Removing some dependency edges from Blob to other caffe2 (#12043)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/12043 Re-trying D9979976, this time with all call sites fixed. D9979976 got reverted because there was a call site that wasn't covered by sandcastle it seems. I fixed it and used 'grep' to ensure there aren't any more call sites in fbsource. Reviewed By: ezyang Differential Revision: D10026392 fbshipit-source-id: cd341514a8e53a40147ea0ee3e52f63bb6444157
Diffstat (limited to 'caffe2/opt')
-rw-r--r--caffe2/opt/fusion.cc10
-rw-r--r--caffe2/opt/onnxifi_transformer.cc2
2 files changed, 6 insertions, 6 deletions
diff --git a/caffe2/opt/fusion.cc b/caffe2/opt/fusion.cc
index fdf5fdc31e..8c324a97c5 100644
--- a/caffe2/opt/fusion.cc
+++ b/caffe2/opt/fusion.cc
@@ -44,10 +44,10 @@ bool fuseConvBNHelper(repr::NNModule* nn, caffe2::Workspace* ws) {
CAFFE_ENFORCE(
bnInputs.size() >= 5, "Invalid batch normalization input size");
-#define EXPOSE_TENSOR_DATA(name, index, inputs) \
- auto name = repr::nn::get<repr::Tensor>(inputs[index]); \
- assert(ws->HasBlob(name->getName()) && "Blob not in workspace"); \
- auto name##Tensor = ws->GetBlob(name->getName())->GetMutableTensor(CPU); \
+#define EXPOSE_TENSOR_DATA(name, index, inputs) \
+ auto name = repr::nn::get<repr::Tensor>(inputs[index]); \
+ assert(ws->HasBlob(name->getName()) && "Blob not in workspace"); \
+ auto name##Tensor = BlobGetMutableTensor(ws->GetBlob(name->getName()), CPU); \
auto name##Data = name##Tensor->mutable_data<float>();
EXPOSE_TENSOR_DATA(filter, 1, convInputs);
@@ -76,7 +76,7 @@ bool fuseConvBNHelper(repr::NNModule* nn, caffe2::Workspace* ws) {
nn->dataFlow.createEdge(convBiasNode, convNode);
auto* blob = ws->CreateBlob(convBiasName);
- caffe2::TensorCPU* tensor = blob->GetMutableTensor(caffe2::CPU);
+ caffe2::TensorCPU* tensor = BlobGetMutableTensor(blob, caffe2::CPU);
CHECK_NOTNULL(tensor);
// Get output channel
size_t c = filterTensor->dim32(0);
diff --git a/caffe2/opt/onnxifi_transformer.cc b/caffe2/opt/onnxifi_transformer.cc
index ce79df56ec..a048503fea 100644
--- a/caffe2/opt/onnxifi_transformer.cc
+++ b/caffe2/opt/onnxifi_transformer.cc
@@ -173,7 +173,7 @@ NetDef OnnxifiTransformer::SubnetToOnnxifiOp(
// Feed into workspace as CPU Tensors
auto* blob = ws->CreateBlob(t.name());
- auto* cpu_tensor = blob->GetMutableTensor(CPU);
+ auto* cpu_tensor = BlobGetMutableTensor(blob, CPU);
std::vector<int64_t> dims;
for(const auto& d : t.dims()) {
dims.push_back(d);