pytorch/torchgen
Peter Bell 5f2e31797a Replace _dtype_default_type_hack (#81479)
Currently any function with a default dtype other than None has to be
manually entered into this function. Instead, this reads the default
directly from `native_functions.yaml`. In order to do this, I also
change `PythonSignatureGroup` to take `tensor_options_args` from the
functional variant since the out variant doesn't actually have tensor
options arguments to take the default values from.

Also note that we need to use `default_init` instead of `default`
because the out argument version doesn't have a `tensor_options`
argument to extract the default value from and so the PythonSignature
objects wouldn't match.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/81479
Approved by: https://github.com/albanD
2022-07-21 16:42:49 +00:00
..
api Replace _dtype_default_type_hack (#81479) 2022-07-21 16:42:49 +00:00
decompositions
dest Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
operator_versions Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
selective_build Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
shape_functions Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
static_runtime Remove unused local variables from generator.py (#81505) 2022-07-18 16:26:59 +00:00
__init__.py
BUCK.oss
BUILD.bazel
build.bzl
code_template.py Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
context.py Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
gen.py [torchgen] support codegen'd C++ API for a mixture of namespaces (#81581) 2022-07-19 07:46:36 +00:00
gen_backend_stubs.py Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
gen_functionalization_type.py fix view_copy kernel striding check logic (#81553) 2022-07-19 13:47:05 +00:00
gen_lazy_tensor.py Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
local.py Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00
model.py Fix circular import error in torchgen (#81355) 2022-07-13 03:16:38 +00:00
native_function_generation.py fix overload ambiguity with functional ops; fix _foreach op grouping (#80556) 2022-07-06 12:45:11 +00:00
utils.py Apply ufmt linter to all py files under torchgen (#81570) 2022-07-16 03:52:25 +00:00