projects
/
platform
/
upstream
/
pytorch.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
666d383
)
call raw_mutable_data when data type didn't match in BlobGetMutableTensor (#14513)
author
Jerry Zhang
<jerryzh@fb.com>
Thu, 29 Nov 2018 23:16:52 +0000
(15:16 -0800)
committer
Facebook Github Bot
<facebook-github-bot@users.noreply.github.com>
Thu, 29 Nov 2018 23:18:58 +0000
(15:18 -0800)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14513
att
Reviewed By: dzhulgakov
Differential Revision:
D13245875
fbshipit-source-id:
3398a1f41a6195e120ed574dee887070e86dfe1f
caffe2/core/blob.h
patch
|
blob
|
history
diff --git
a/caffe2/core/blob.h
b/caffe2/core/blob.h
index
9f493e5
..
0227c67
100644
(file)
--- a/
caffe2/core/blob.h
+++ b/
caffe2/core/blob.h
@@
-45,8
+45,7
@@
BlobGetMutableTensor(Blob* blob, at::IntList dims, at::TensorOptions options) {
if (tensor->dtype() == options.dtype()) {
tensor->raw_mutable_data();
} else {
- // create a new Tensor when the data_type doesn't match
- return BlobSetTensor(blob, caffe2::empty(dims, options));
+ tensor->raw_mutable_data(options.dtype());
}
return tensor;
}