Summary:
1) sparse_dispatches in native_parse was not used anymore, got rid of it.
2) got rid of overloaded sizes_ in SparseTensorImpl, which just uses the base implementation.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/18962
Differential Revision:
D14811545
Pulled By: gchanan
fbshipit-source-id:
2fa60ef50456b5f605caa63beae1d8d2542fd527
AT_ASSERT(values_.device() == device());
}
-IntArrayRef SparseTensorImpl::sizes() const {
- return sizes_;
-}
IntArrayRef SparseTensorImpl::strides() const {
AT_ERROR("sparse tensors do not have strides");
}
Tensor indices() const { return indices_; }
Tensor values() const { return values_; }
- IntArrayRef sizes() const override;
IntArrayRef strides() const override;
bool is_contiguous() const override;
int64_t stride(int64_t d) const override;
return arguments
-def has_sparse_dispatches(dispatches):
- for dispatch in dispatches:
- if 'Sparse' in dispatch:
- return True
- return False
-
-
def parse_native_yaml(path):
with open(path, 'r') as f:
return yaml.load(f, Loader=Loader)