Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Mar 1, 2020

See Commits and Changes for more details.


Created by pull[bot]. Want to support this open source service? Please star it : )

Summary:
Pull Request resolved: #33536

Simple fix, merge the identical string literals that were being inlined into every wrapper for ops that don't support named tensors. E.g.
```
Tensor all(const Tensor & self, int64_t dim, bool keepdim) {
    if (self.has_names()) {
        AT_ERROR(
            "all is not yet supported with named tensors. Please drop names via "
            "`tensor = tensor.rename(None)`, call the op with an unnamed tensor, "
            "and set names on the result of the operation.");
    }
    const OptionalDeviceGuard device_guard(device_of(self));
    return at::native::all(self, dim, keepdim);
}
```
becomes
```
Tensor all(const Tensor & self, int64_t dim, bool keepdim) {
    if (self.has_names()) {
        AT_ERROR("all", named_tensors_unsupported_error);
    }
    const OptionalDeviceGuard device_guard(device_of(self));
    return at::native::all(self, dim, keepdim);
}
```

Also updated the generated file comments to include the source template names, e.g.
```
// generated by aten/src/ATen/gen.py from TypeDefault.cpp
```

Test Plan: Imported from OSS

Differential Revision: D19993407

Pulled By: bhosmer

fbshipit-source-id: 88395a649e6ba53191332344123555c217c5eb40
@pull pull bot added the ⤵️ pull label Mar 1, 2020
@pull pull bot merged commit 7747fe8 into peterjc123:master Mar 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants