pytorch / captum

Model interpretability and understanding for PyTorch
https://captum.ai
BSD 3-Clause "New" or "Revised" License
4.94k stars 499 forks source link

Resolve C417 in tcav.py #1426

Closed craymichael closed 3 weeks ago

craymichael commented 3 weeks ago

Summary: Resolve flake8 lint

>>> Lint for fbcode/pytorch/captum/captum/concept/_core/tcav.py:

   Advice  (FLAKE8) C417
    Unnecessary use of map - use a list comprehension instead.
    See https://github.com/adamchainz/flake8-comprehensions#rules

             694         # Retrieves the lengths of the experimental sets so that we can sort
             695         # them by the length and compute TCAV scores in batches.
             696         exp_set_lens = np.array(
    >>>      697             list(map(lambda exp_set: len(exp_set), experimental_sets)), dtype=object
             698         )
             699         exp_set_lens_arg_sort = np.argsort(exp_set_lens)

Differential Revision: D65178563

facebook-github-bot commented 3 weeks ago

This pull request was exported from Phabricator. Differential Revision: D65178563

facebook-github-bot commented 3 weeks ago

This pull request was exported from Phabricator. Differential Revision: D65178563

facebook-github-bot commented 3 weeks ago

This pull request has been merged in pytorch/captum@d28efcd4d59872c41d3932dfaca4e2f1212bdd7c.