ZAIDX11's picture
Add files using upload-large-folder tool
effde1c verified
"""
Minimal shim for `captum.attr.IntegratedGradients` used in neuro_symbolic explainability.
This avoids requiring the real Captum package during test collection while still allowing
code that imports `IntegratedGradients` to run (as a no-op shim).
"""
from typing import Any, Tuple
class IntegratedGradients:
def __init__(self, model: Any):
self.model = model
def attribute(self, inputs: Any, target: int = 0, return_convergence_delta: bool = False) -> Tuple[Any, Any]:
# Return zero-attribution and zero delta
import numpy as np
attr = np.zeros_like(inputs)
delta = 0.0
return attr, delta
__all__ = ["IntegratedGradients"]