Skip to content

Conversation

ezyang
Copy link
Contributor

@ezyang ezyang commented Sep 12, 2018

Stack:
    :black_circle:  #11576 Centralize TypeExtendedInterface casts.  💚
    :white_circle:  #11583 Remove deprecated factory functions from Type.  💚

Previously, they were spattered throughout the codebase.
We now follow this convention:

  • LegacyTypeDispatch gives you Type
  • Context gives you TypeExtendedInterface
  • Tensor::type() gives you Type
  • at::getType() gives you TypeExtendedInterface

I change some sites to use getType() over type().

Differential Revision: D9790187

Differential Revision: D9790187
Differential Version: 57609071
Differential Revision: D9790187
Differential Version: 57641656
static inline TypeExtendedInterface & infer_type(const Tensor & t) {
AT_CHECK(t.defined(), "undefined Tensor");
return static_cast<TypeExtendedInterface&>(t.type());
return getType(t.unsafeGetTensorImpl());

This comment was marked as off-topic.

This comment was marked as off-topic.

backend, impl->scalar_type(), impl->is_variable());
}

TypeExtendedInterface& getType(const Tensor& impl) {

This comment was marked as off-topic.

}
static inline TypeExtendedInterface & non_specific_type() {
return static_cast<TypeExtendedInterface&>(at::getNonVariableType(at::Backend::Undefined, at::ScalarType::Float));
return getType(tl[0].unsafeGetTensorImpl());

This comment was marked as off-topic.

Differential Revision: D9790187
Differential Version: 57784244
Differential Revision: D9790187
Differential Version: 57805354
zdevito pushed a commit to zdevito/ATen that referenced this pull request Sep 14, 2018
Summary:
Pull Request resolved: pytorch/pytorch#11576

Previously, they were spattered throughout the codebase.
We now follow this convention:

- LegacyTypeDispatch gives you Type
- Context gives you TypeExtendedInterface
- Tensor::type() gives you Type
- at::getType() gives you TypeExtendedInterface

I change some sites to use getType() over type().

Reviewed By: SsnL

Differential Revision: D9790187

fbshipit-source-id: 5e2577cb590a5bbf5df530f3763d3b3c0b4625ca
@soumith soumith deleted the export-D9790187 branch February 21, 2019 12:10
@ezyang ezyang added the merged label Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants