Skip to content

I discovered what appears to be a forgotten class, called captum.attr.InputBaselineXGradient #989

@ProGamerGov

Description

@ProGamerGov

🐛 Bug

I found a module that was listed in the code and on the API docs site, but there's not public path to use it and no tests were ever written for it:

captum.attr.InputBaselineXGradient # Missing tests

https://github.com/pytorch/captum/blob/master/captum/attr/_core/gradient_shap.py#L292
Listed as part of the website API here: https://github.com/pytorch/captum/blob/master/sphinx/source/gradient_shap.rst

I discovered this module's existence from the Sphinx logs:

WARNING: autodoc: failed to import class 'InputBaselineXGradient' from module 'captum.attr'; the following exception was raised:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/sphinx/util/inspect.py", line 448, in safe_getattr
    return getattr(obj, name, *defargs)
AttributeError: module 'captum.attr' has no attribute 'InputBaselineXGradient'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/dist-packages/sphinx/ext/autodoc/importer.py", line 110, in import_object
    obj = attrgetter(obj, mangled_name)
  File "/usr/local/lib/python3.7/dist-packages/sphinx/ext/autodoc/__init__.py", line 332, in get_attr
    return autodoc_attrgetter(self.env.app, obj, name, *defargs)
  File "/usr/local/lib/python3.7/dist-packages/sphinx/ext/autodoc/__init__.py", line 2780, in autodoc_attrgetter
    return safe_getattr(obj, name, *defargs)
  File "/usr/local/lib/python3.7/dist-packages/sphinx/util/inspect.py", line 464, in safe_getattr
    raise AttributeError(name) from exc
AttributeError: InputBaselineXGradient

Edit:

It appears like a decision was made to not make InputBaselineXGradient in #175 back in 2019, but it's not used anywhere in the Captum code at the moment: https://github.com/pytorch/captum/search?q=InputBaselineXGradient

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions