Skip to content

Commit a255953

Browse files
styusuffacebook-github-bot
authored andcommitted
Moving tests.attr.helpers to captum.testing.attr.helpers (#1492)
Summary: Pull Request resolved: #1492 This Diff is to move the tests.attr.helpers functions away from the tests namespace and move it inside the captum library. Reviewed By: jjuncho Differential Revision: D68445008 fbshipit-source-id: eeeeb1211f570c5f6867db3886cf18438f6c0334
1 parent b487891 commit a255953

18 files changed

+49
-49
lines changed

tests/attr/layer/test_layer_conductance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import torch
99
from captum._utils.typing import BaselineType
1010
from captum.attr._core.layer.layer_conductance import LayerConductance
11+
from captum.testing.attr.helpers.conductance_reference import ConductanceReference
1112
from captum.testing.helpers.basic import (
1213
assertTensorAlmostEqual,
1314
assertTensorTuplesAlmostEqual,
@@ -19,7 +20,6 @@
1920
BasicModel_MultiLayer_MultiInput,
2021
)
2122
from packaging import version
22-
from tests.attr.helpers.conductance_reference import ConductanceReference
2323
from torch import Tensor
2424
from torch.nn import Module
2525

tests/attr/layer/test_layer_deeplift.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99

1010
import torch
1111
from captum.attr._core.layer.layer_deep_lift import LayerDeepLift, LayerDeepLiftShap
12+
from captum.testing.attr.helpers.neuron_layer_testing_util import (
13+
create_inps_and_base_for_deeplift_neuron_layer_testing,
14+
create_inps_and_base_for_deepliftshap_neuron_layer_testing,
15+
)
1216
from captum.testing.helpers.basic import (
1317
assert_delta,
1418
assertTensorAlmostEqual,
@@ -24,10 +28,6 @@
2428
ReLULinearModel,
2529
)
2630
from packaging import version
27-
from tests.attr.helpers.neuron_layer_testing_util import (
28-
create_inps_and_base_for_deeplift_neuron_layer_testing,
29-
create_inps_and_base_for_deepliftshap_neuron_layer_testing,
30-
)
3131
from torch import Tensor
3232

3333

tests/attr/layer/test_layer_gradient_shap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
LayerGradientShap,
1414
LayerInputBaselineXGradient,
1515
)
16+
from captum.testing.attr.helpers.attribution_delta_util import assert_attribution_delta
1617
from captum.testing.helpers.basic import (
1718
assertTensorAlmostEqual,
1819
assertTensorTuplesAlmostEqual,
@@ -24,7 +25,6 @@
2425
)
2526
from captum.testing.helpers.classification_models import SoftmaxModel
2627
from packaging import version
27-
from tests.attr.helpers.attribution_delta_util import assert_attribution_delta
2828
from torch import Tensor
2929
from torch.nn import Module
3030

0 commit comments

Comments
 (0)