From bba96db2a5b50d24467313867a2f7808103669ba Mon Sep 17 00:00:00 2001 From: Jerry Zhang Date: Fri, 12 Apr 2019 18:10:37 -0700 Subject: [PATCH] fix lint errors in gen.py (#19221) Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/19221 att Reviewed By: colesbury Differential Revision: D14923858 fbshipit-source-id: 4793d7794172d401455c5ce72dfc27dddad515d4 --- aten/src/ATen/gen.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/aten/src/ATen/gen.py b/aten/src/ATen/gen.py index 08da16b..b89dd02 100644 --- a/aten/src/ATen/gen.py +++ b/aten/src/ATen/gen.py @@ -174,13 +174,15 @@ generators = { }, } -backends = ['CPU', 'CUDA', 'QuantizedCPU'] -densities = ['Dense', 'Sparse', 'Mkldnn'] # TODO: layout instead of densities? + def backend_to_devicetype(backend): if backend == 'QuantizedCPU': return 'CPU' return backend +backends = ['CPU', 'CUDA', 'QuantizedCPU'] +densities = ['Dense', 'Sparse', 'Mkldnn'] # TODO: layout instead of densities? + quantized_backends = ['QuantizedCPU'] extension_backends = ['MSNPU', 'XLA'] @@ -203,7 +205,6 @@ scalar_types = [ ] + quantized_scalar_types - # shared environment for non-derived base classes Type.h Tensor.h Storage.h top_env = { 'cpu_type_registrations': [], @@ -439,7 +440,7 @@ def iterate_types(): continue if backend in quantized_backends: if density == 'Dense' and scalar_type in quantized_scalar_types: - yield (backend, density, scalar_type) + yield (backend, density, scalar_type) else: continue else: -- 2.7.4