Skip to content

Commit

Permalink
auto-lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-dev-bot committed Jul 13, 2024
1 parent 2fc15c8 commit c4066d2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
9 changes: 5 additions & 4 deletions ivy/functional/backends/jax/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@


def container_types() -> List[Type]:
"""
Gets list of container types supported.
"""Gets list of container types supported.
Returns:
Returns
-------
List[Type]: List containing the FlatMapping container type.
Examples:
Examples
--------
>>> container_types()
[FlatMapping]
"""
Expand Down
6 changes: 3 additions & 3 deletions ivy/functional/ivy/losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ def ssim_loss(
ivy.array(0.99989986)
"""
# Constants for stability
C1 = 0.01 ** 2
C2 = 0.03 ** 2
C1 = 0.01**2
C2 = 0.03**2

# Calculate the mean of the two images
mu_x = ivy.avg_pool2d(pred, (3, 3), (1, 1), "SAME")
Expand All @@ -429,7 +429,7 @@ def ssim_loss(

# Calculate SSIM
ssim = ((2 * mu_x * mu_y + C1) * (2 * sigma_xy + C2)) / (
(mu_x ** 2 + mu_y ** 2 + C1) * (sigma_x2 + sigma_y2 + C2)
(mu_x**2 + mu_y**2 + C1) * (sigma_x2 + sigma_y2 + C2)
)

# Convert SSIM to loss
Expand Down
4 changes: 3 additions & 1 deletion ivy_tests/test_ivy/test_functional/test_nn/test_losses.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,9 @@ def test_wasserstein_loss_discriminator(
min_dim_size=2,
),
)
def test_wasserstein_loss_generator(dtype_and_pred_fake, test_flags, backend_fw, fn_name, on_device):
def test_wasserstein_loss_generator(
dtype_and_pred_fake, test_flags, backend_fw, fn_name, on_device
):
dtype_pred_fake, pred_fake = dtype_and_pred_fake

helpers.test_function(
Expand Down

0 comments on commit c4066d2

Please sign in to comment.