forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compute common dtype based on inputs only (pytorch#25593)
Summary: Currently we compute common dtype for TensorIterator based on all inputs and outputs. It can be a problem when dtype of the outputs should be different from dtype of inputs. (Example torch.eq) We also have `dont_compute_common_dtype` method that allows us to avoid a computation of a common dtype for all inputs and outputs. This PR will give the ability to compute common dtype based only on inputs using `compute_common_dtype_only_for_inputs`. Also it will provide a simple method `input_dtype(int arg=0) that will give the ability to dispatch based on input's dtype. ``` AT_DISPATCH_ALL_TYPES(iter.input_dtype(), ... ``` Pull Request resolved: pytorch#25593 Differential Revision: D17286352 Pulled By: ifedan fbshipit-source-id: a94fb608acd2763120992fe85b8dfd02ff21f9ba
- Loading branch information
1 parent
8f7020b
commit e69a6ba
Showing
3 changed files
with
109 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters