[TENSOR MERGE] Delete Tensor::typeString()#9764
[TENSOR MERGE] Delete Tensor::typeString()#9764ezyang wants to merge 3 commits intopytorch:masterfrom
Conversation
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
The primary use-site of typeString was checked_cast_tensor. I did a little more than I needed in this patch, to set the stage for actually deleting the tensor type. Specifically, I modified checked_cast_tensor to explicitly take Backend and ScalarType, the idea being that once we remove the tensor subclasses, we will delete the T template parameter. Signed-off-by: Edward Z. Yang <ezyang@fb.com>
cc9cc8c to
4a3ef03
Compare
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
|
||
| // Converts a TensorList (i.e. ArrayRef<Tensor> to the underlying TH* Tensor Pointer) | ||
| template <typename T, typename TBase, typename TH> | ||
| static inline std::vector<TH*> tensor_list_checked_cast(ArrayRef<TBase> tensors, const char * name, int pos) { |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
aten/src/ATen/Utils.h
Outdated
| casted[i] = result->tensor; | ||
| } else { | ||
| AT_ERROR("Expected a Tensor of type ", T::typeString(), " but found a type ", expr->type().toString(), | ||
| AT_ERROR("Expected a Tensor of RAII type ", typeid(T).name(), " but found a type ", typeid(*expr).name(), |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
facebook-github-bot
left a comment
There was a problem hiding this comment.
@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
@pytorchbot retest this please |
1 similar comment
|
@pytorchbot retest this please |
Summary: The primary use-site of typeString was checked_cast_tensor. I did a little more than I needed in this patch, to set the stage for actually deleting the tensor type. Specifically, I modified checked_cast_tensor to explicitly take Backend and ScalarType, the idea being that once we remove the tensor subclasses, we will delete the T template parameter. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Pull Request resolved: pytorch/pytorch#9764 Differential Revision: D8969196 Pulled By: ezyang fbshipit-source-id: 9de92b974b2c28f12ddad13429917515810f24c6
Summary: The primary use-site of typeString was checked_cast_tensor. I did a little more than I needed in this patch, to set the stage for actually deleting the tensor type. Specifically, I modified checked_cast_tensor to explicitly take Backend and ScalarType, the idea being that once we remove the tensor subclasses, we will delete the T template parameter. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Pull Request resolved: pytorch#9764 Differential Revision: D8969196 Pulled By: ezyang fbshipit-source-id: 9de92b974b2c28f12ddad13429917515810f24c6
Summary: The primary use-site of typeString was checked_cast_tensor. I did a little more than I needed in this patch, to set the stage for actually deleting the tensor type. Specifically, I modified checked_cast_tensor to explicitly take Backend and ScalarType, the idea being that once we remove the tensor subclasses, we will delete the T template parameter. Signed-off-by: Edward Z. Yang <ezyang@fb.com> Pull Request resolved: pytorch#9764 Differential Revision: D8969196 Pulled By: ezyang fbshipit-source-id: 9de92b974b2c28f12ddad13429917515810f24c6
The primary use-site of typeString was checked_cast_tensor.
I did a little more than I needed in this patch, to set
the stage for actually deleting the tensor type.
Specifically, I modified checked_cast_tensor to explicitly
take Backend and ScalarType, the idea being that once we
remove the tensor subclasses, we will delete the T template
parameter.
Signed-off-by: Edward Z. Yang ezyang@fb.com