Skip to content

Fix return style formatting #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master-rst-fixes
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions captum/attr/_core/deep_lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def attribute( # type: ignore

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution score computed based on DeepLift rescale rule with respect
to each input feature. Attributions will always be
the same size as the provided inputs, with each value
Expand Down Expand Up @@ -791,7 +791,7 @@ def attribute( # type: ignore

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution score computed based on DeepLift rescale rule with
respect to each input feature. Attributions will always be
the same size as the provided inputs, with each value
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/feature_ablation.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ def attribute(
Default: None

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The attributions with respect to each input feature.
If the forward function returns
a scalar value per example, attributions will be
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/feature_permutation.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def attribute( # type: ignore
Default: None

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The attributions with respect to each input feature.
If the forward function returns
a scalar value per example, attributions will be
Expand Down
2 changes: 1 addition & 1 deletion captum/attr/_core/gradient_shap.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def attribute(
Default: False
Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution score computed based on GradientSHAP with respect
to each input feature. Attributions will always be
the same size as the provided inputs, with each value
Expand Down
8 changes: 4 additions & 4 deletions captum/attr/_core/guided_backprop_deconvnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,8 @@ def attribute(
Default: None

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The guided backprop gradients with respect to each
input feature. Attributions will always
be the same size as the provided inputs, with each value
Expand Down Expand Up @@ -297,8 +297,8 @@ def attribute(
Default: None

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The deconvolution attributions with respect to each
input feature. Attributions will always
be the same size as the provided inputs, with each value
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/input_x_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ def attribute(
Default: None

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The input x gradient with
respect to each input feature. Attributions will always be
the same size as the provided inputs, with each value
Expand Down
2 changes: 1 addition & 1 deletion captum/attr/_core/integrated_gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def attribute( # type: ignore
Default: False
Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Integrated gradients with respect to each input feature.
attributions will always be the same size as the provided
inputs, with each value providing the attribution of the
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/kernel_shap.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def attribute( # type: ignore
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The attributions with respect to each input feature.
If return_input_shape = True, attributions will be
the same size as the provided inputs, with each value
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/layer/grad_cam.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ def attribute(
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Attributions based on GradCAM method.
Attributions will be the same size as the
output of the given layer, except for dimension 2,
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/layer/internal_influence.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def attribute(
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Internal influence of each neuron in given
layer output. Attributions will always be the same size
as the output or input of the given layer depending on
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/layer/layer_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ def attribute(
Default: False

Returns:
*tensor* or tuple of *tensors* or list of **attributions**:
- **attributions** (*tensor* or tuple of *tensors* or *list*):
*tensor* or *tuple* of *tensors* or *list* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors* or *list*):
Activation of each neuron in given layer output.
Attributions will always be the same size as the
output of the given layer.
Expand Down
2 changes: 1 addition & 1 deletion captum/attr/_core/layer/layer_conductance.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def attribute(

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Conductance of each neuron in given layer input or
output. Attributions will always be the same size as
the input or output of the given layer, depending on
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/layer/layer_deep_lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ def attribute(

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution score computed based on DeepLift's rescale rule with
respect to layer's inputs or outputs. Attributions will always be the
same size as the provided layer's inputs or outputs, depending on
Expand Down Expand Up @@ -587,7 +587,7 @@ def attribute(

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution score computed based on DeepLift's rescale rule
with respect to layer's inputs or outputs. Attributions
will always be the same size as the provided layer's inputs
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/layer/layer_feature_ablation.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ def attribute(
Default: 1

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution of each neuron in given layer input or
output. Attributions will always be the same size as
the input or output of the given layer, depending on
Expand Down
2 changes: 1 addition & 1 deletion captum/attr/_core/layer/layer_gradient_shap.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def attribute(
Default: False
Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution score computed based on GradientSHAP with
respect to layer's input or output. Attributions will always
be the same size as the provided layer's inputs or outputs,
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/layer/layer_gradient_x_activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def attribute(
Default: False

Returns:
*tensor* or tuple of *tensors* or list of **attributions**:
- **attributions** (*tensor* or tuple of *tensors* or *list*):
*tensor* or *tuple* of *tensors* or *list* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors* or *list*):
Product of gradient and activation for each
neuron in given layer output.
Attributions will always be the same size as the
Expand Down
6 changes: 3 additions & 3 deletions captum/attr/_core/layer/layer_lrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,10 @@ def attribute(
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions** or 2-element tuple of
**attributions**, **delta** or list of **attributions** and **delta**:
*tensor* or *tuple* of *tensors* of **attributions** or 2-element tuple of
**attributions**, **delta** or *list* of **attributions** and **delta**:

- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
The propagated relevance values with respect to each
input feature. Attributions will always
be the same size as the provided inputs, with each value
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/lime.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,8 +1013,8 @@ def attribute( # type: ignore
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The attributions with respect to each input feature.
If return_input_shape = True, attributions will be
the same size as the provided inputs, with each value
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/lrp.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,10 @@ def attribute(
of rules is printed during propagation.

Returns:
*tensor* or tuple of *tensors* of **attributions**
*tensor* or *tuple* of *tensors* of **attributions**
or 2-element tuple of **attributions**, **delta**:

- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
The propagated relevance values with respect to each
input feature. The values are normalized by the output score
value (sum(relevance)=1). To obtain values comparable to other
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/neuron/neuron_conductance.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,8 @@ def attribute(
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Conductance for
particular neuron with respect to each input feature.
Attributions will always be the same size as the provided
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/neuron/neuron_deep_lift.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def attribute(

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Computes attributions using Deeplift's rescale rule for
particular neuron with respect to each input feature.
Attributions will always be the same size as the provided
Expand Down Expand Up @@ -445,7 +445,7 @@ def attribute(

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Computes attributions using Deeplift's rescale rule for
particular neuron with respect to each input feature.
Attributions will always be the same size as the provided
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/neuron/neuron_feature_ablation.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ def attribute(
Default: 1

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Attributions of particular neuron with respect to each input
feature. Attributions will always be the same size as the
provided inputs, with each value providing the attribution
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/neuron/neuron_gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ def attribute(
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Gradients of particular neuron with respect to each input
feature. Attributions will always be the same size as the
provided inputs, with each value providing the attribution
Expand Down
2 changes: 1 addition & 1 deletion captum/attr/_core/neuron/neuron_gradient_shap.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def attribute(

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution score computed based on GradientSHAP with respect
to each input feature. Attributions will always be
the same size as the provided inputs, with each value
Expand Down
8 changes: 4 additions & 4 deletions captum/attr/_core/neuron/neuron_guided_backprop_deconvnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ def attribute(
Support for multiple tensors will be added later.
Default: False
Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Deconvolution attribution of
particular neuron with respect to each input feature.
Attributions will always be the same size as the provided
Expand Down Expand Up @@ -303,8 +303,8 @@ def attribute(
Support for multiple tensors will be added later.
Default: False
Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Guided backprop attribution of
particular neuron with respect to each input feature.
Attributions will always be the same size as the provided
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/neuron/neuron_integrated_gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ def attribute(
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
Integrated gradients for particular neuron with
respect to each input feature.
Attributions will always be the same size as the provided
Expand Down
2 changes: 1 addition & 1 deletion captum/attr/_core/noise_tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def attribute(

Returns:
**attributions** or 2-element tuple of **attributions**, **delta**:
- **attributions** (*tensor* or tuple of *tensors*):
- **attributions** (*tensor* or *tuple* of *tensors*):
Attribution with
respect to each input feature. attributions will always be
the same size as the provided inputs, with each value
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/occlusion.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@ def attribute( # type: ignore
Default: False

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The attributions with respect to each input feature.
Attributions will always be
the same size as the provided inputs, with each value
Expand Down
4 changes: 2 additions & 2 deletions captum/attr/_core/saliency.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ def attribute(
Default: None

Returns:
*tensor* or tuple of *tensors* of **attributions**:
- **attributions** (*tensor* or tuple of *tensors*):
*tensor* or *tuple* of *tensors* of **attributions**:
- **attributions** (*tensor* or *tuple* of *tensors*):
The gradients with respect to each input feature.
Attributions will always be
the same size as the provided inputs, with each value
Expand Down
Loading