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:
ba6c49c
)
condition blob in while_op test changes data type (#14279)
author
Jerry Zhang
<jerryzh@fb.com>
Tue, 27 Nov 2018 22:10:41 +0000
(14:10 -0800)
committer
Facebook Github Bot
<facebook-github-bot@users.noreply.github.com>
Tue, 27 Nov 2018 22:16:39 +0000
(14:16 -0800)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/14279
att
Reviewed By: smessmer
Differential Revision:
D13144472
fbshipit-source-id:
af4d920a3148c648d1a428a5bcd56da19ea8c38c
caffe2/core/blob.h
patch
|
blob
|
history
diff --git
a/caffe2/core/blob.h
b/caffe2/core/blob.h
index
3873572
..
7726b6d
100644
(file)
--- a/
caffe2/core/blob.h
+++ b/
caffe2/core/blob.h
@@
-44,7
+44,10
@@
BlobGetMutableTensor(Blob* blob, at::IntList dims, at::TensorOptions options) {
tensor->raw_mutable_data();
} else {
// create a new Tensor when the data_type doesn't match
- return BlobSetTensor(blob, caffe2::empty(dims, options));
+ C10_LOG_EVERY_MS(WARNING, 1000)
+ << "data type mismatch in BlobGetMutableTensor:"
+ << tensor->dtype() << " and " << options.dtype();
+ tensor->raw_mutable_data(options.dtype());
}
return tensor;
}