Skip to content

Remove Type::ScalarType()#17792

Closed
li-roy wants to merge 8 commits intoexport-D14379075from
export-D14381774
Closed

Remove Type::ScalarType()#17792
li-roy wants to merge 8 commits intoexport-D14379075from
export-D14381774

Conversation

@li-roy
Copy link
Contributor

@li-roy li-roy commented Mar 8, 2019

Stack:
    :white_circle:  #17530 Small clean up of aten_op  💚
    :white_circle:  #17601 Store ScalarType and Backend instead of Type in TensorIterator  💚
    :white_circle:  #17785 Remove Type::elementSizeInBytes  💚
    :white_circle:  #17723 Store python default type as PyTensorType instead of at::Type  💚
    :white_circle:  #17786 Pass ScalarType separately from Type in python constructors  💚
    :black_circle:  #17792 Remove Type::ScalarType()  💚
    :white_circle:  #17603 Remove conversion operator from Type to TensorOptions  💛
    :white_circle:  #17787 Add ScalarType arg to Type::options()  💛

Differential Revision: D14381774

Differential Revision: D14381774
Differential Version: 74716818

Type & TypeDefault::toBackend(Backend b) const {
return at::globalContext().getNonVariableType(b,scalarType());
return at::globalContext().getNonVariableType(b,typeMetaToScalarType(typeMeta()));
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is orthogonal and not making progress (typeMeta() needs to go), but I'd like to just get rid of scalarType() for now.

Differential Revision: D14381774
Differential Version: 74726649
void set_default_tensor_type(PyTensorType& type) {
auto aten_type = type.aten_type();
if (!at::isFloatingType(aten_type->scalarType())) {
if (!at::isFloatingType(static_cast<at::ScalarType>(type.scalar_type))) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised you need a cast here

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whooooooo

royboy added 6 commits March 8, 2019 13:11
Differential Revision: D14381774
Differential Version: 74808627
Differential Revision: D14381774
Differential Version: 74811454
Differential Revision: D14381774
Differential Version: 74818454
Differential Revision: D14381774
Differential Version: 74831196
Differential Revision: D14381774
Differential Version: 74843003
Differential Revision: D14381774
Differential Version: 74983514
@li-roy li-roy closed this Apr 16, 2019
@ezyang ezyang deleted the export-D14381774 branch May 30, 2019 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants