pytorch
49f13361 - Add Tensor::is_cpu, genericize TensorIterator (#54079)

Commit
4 years ago
Add Tensor::is_cpu, genericize TensorIterator (#54079) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/54079 Fixes https://github.com/pytorch/pytorch/issues/53815 Instead of testing if something is CUDA, we instead test if something is not CPU. This in the general theming of "Don't be so darn CUDA centric". Intruigingly, we didn't have a is_cpu() method on Tensor. Which seems like a big oversight and one of the reasons how we ended up in this mess. So in it goes. Maybe we should also get this for Python bindings as well (but in that case, should probably look into redoing all of the is_X bindings so they aren't done manually). Signed-off-by: Edward Z. Yang <ezyang@fb.com> Test Plan: Imported from OSS Reviewed By: ngimel Differential Revision: D27109507 Pulled By: ezyang fbshipit-source-id: abbe72c2e688c452ffe098d206cb79938b5824b1
Author
Parents
Loading