[pt1][tensor] caffe2::empty for Resize+mutable_data refactor#12407
Closed
jerryzh168 wants to merge 70 commits intomasterfrom
Closed
[pt1][tensor] caffe2::empty for Resize+mutable_data refactor#12407jerryzh168 wants to merge 70 commits intomasterfrom
jerryzh168 wants to merge 70 commits intomasterfrom
Conversation
Differential Revision: D9779821 Differential Version: 57806436
Differential Revision: D9779821 Differential Version: 58713403
Differential Revision: D9779821 Differential Version: 58748651
Differential Revision: D9889990 Differential Version: 58748485
Differential Revision: D9889990 Differential Version: 58751934
Differential Revision: D10033396 Differential Version: 58815881
Differential Revision: D9889990 Differential Version: 58856304
Differential Revision: D10033396 Differential Version: 58856963
Differential Revision: D9889990 Differential Version: 58875107
Differential Revision: D10022853 Differential Version: 58947676
Differential Revision: D10033396 Differential Version: 59085834
Differential Revision: D9889990 Differential Version: 59110247
Differential Revision: D10033396 Differential Version: 59227528
Differential Revision: D9889990 Differential Version: 59619253
Differential Revision: D9889990 Differential Version: 59621759
Differential Revision: D10001033 Differential Version: 59624116
Differential Revision: D9889990 Differential Version: 59625764
This was referenced Dec 28, 2018
This was referenced Jan 9, 2019
This was referenced Jan 25, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack:
:black_circle: #12407 [pt1][tensor] caffe2::empty for Resize+mutable_data refactor 💚
Motivation
We want to use tensor factory to refactor the caffe2's old way of initialize Tensor by Resize and mutable_data
in order to eliminate uninitialized Tensor.
Previously when we want to create a Tensor in caffe2, we'll do the following
This leaves Tensor in not fully initialized state during the process, to eliminate this, we
want to provide all the needed information in the begining. ATen already has its TensorFactories: https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/native/TensorFactories.cpp, and there is a TensorOption, we want to adopt the same interface to ease future refactoring.
In the callsite, we used to have
Output(i)that returns aBlobthat contains an uninitializedTensorand we'll call Resize and mutable_data afterwards to provide dimension and data type,We want to change it to the following:
Perf result
microbenchmarks
Differential Revision: D10207890