pytorch/torch/jit
Alexander Grund 93719440b8 Replace map(lambda constructs (#46462)
Summary:
Follow-up of https://github.com/pytorch/pytorch/issues/46461 with a similar goal

Makes them more readable and possibly faster. Care has to be taken because `map` applies the function immediately while `(x for x in xs)` is a generator expression which gets evaluated later. This is a benefit in some cases where it is not required to actually create the list of values in memory (e.g. when passing to `tuple` or `extend` or `join`)

Pull Request resolved: https://github.com/pytorch/pytorch/pull/46462

Reviewed By: zou3519

Differential Revision: D24422343

Pulled By: ezyang

fbshipit-source-id: 252e33499c92ac0b15238f2df32681dbbda2b237
2020-10-22 09:50:22 -07:00
..
mobile Move async + serialization implementation out of 'jit/__init__.py' (#41018) 2020-07-09 10:10:01 -07:00
__init__.py [JIT] adding torch.jit.isinstance support (#46062) 2020-10-20 16:47:49 -07:00
_async.py move misc implementation out of jit/__init__.py (#41154) 2020-07-13 16:59:55 -07:00
_builtins.py [JIT] Add mypy type annotations for JIT (#43862) 2020-09-03 15:09:24 -07:00
_freeze.py move misc implementation out of jit/__init__.py (#41154) 2020-07-13 16:59:55 -07:00
_fuser.py Respect canFuseOn{CPU,GPU} in TE fuser (#43967) 2020-09-02 18:00:25 -07:00
_logging.py Experimental logging/counters API (#18235) 2019-03-29 17:14:03 -07:00
_pickle.py [jit] Add type tags to lists/dicts in pickle (#33255) 2020-03-10 19:17:01 -07:00
_recursive.py torch.nn.modules.LazyModuleMixin and torch.nn.LazyLinear (Shape Inference II) (#44538) 2020-10-19 13:13:54 -07:00
_script.py Fix TypeError when torch.jit.load is passed a pathlib.Path (#45825) 2020-10-08 01:29:29 -07:00
_serialization.py Fix TypeError when torch.jit.load is passed a pathlib.Path (#45825) 2020-10-08 01:29:29 -07:00
_state.py [JIT] Improve class type annotation inference (#45940) 2020-10-14 23:28:47 -07:00
_trace.py Expose script_if_tracing as public API (#46494) 2020-10-17 17:31:57 -07:00
annotations.py [JIT] Improve class type annotation inference (#45940) 2020-10-14 23:28:47 -07:00
frontend.py Allow for source code comments at any level of indentation (#46548) 2020-10-21 13:49:42 -07:00
quantized.py Enable typechecks for torch.nn.quantized.modules.linear (#44154) 2020-09-03 19:52:49 -07:00
supported_ops.py [JIT] Add mypy type annotations for JIT (#43862) 2020-09-03 15:09:24 -07:00
unsupported_tensor_ops.py Replace map(lambda constructs (#46462) 2020-10-22 09:50:22 -07:00