Skip to content

Commit bcbb694

Browse files
committed
Merge remote-tracking branch 'upstream/master' into serializability_tests
2 parents c6be389 + 1e146df commit bcbb694

File tree

3 files changed

+4
-22
lines changed

3 files changed

+4
-22
lines changed

docs/tutorials/_toc.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,7 @@ toc:
1818
path: /addons/tutorials/tqdm_progress_bar
1919
- title: Seq2Seq for Translation
2020
path: /addons/tutorials/networks_seq2seq_nmt
21+
- title: Moving Average Optimizer Checkpoint
22+
path: /addons/tutorials/average_optimizers_callback
23+
- title: Time Stopping Callback
24+
path: /addons/tutorials/time_stopping

tensorflow_addons/losses/npairs.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,12 @@
1414
# ==============================================================================
1515
"""Implements npairs loss."""
1616

17-
import platform
18-
1917
import tensorflow as tf
2018

2119
from tensorflow_addons.utils.types import TensorLike
2220
from typeguard import typechecked
2321

2422

25-
def check_if_windows(name):
26-
if platform.system() != "Windows":
27-
return
28-
raise NotImplementedError(
29-
"The function {} is not yet available on Windows.".format(name)
30-
)
31-
32-
3323
@tf.keras.utils.register_keras_serializable(package="Addons")
3424
@tf.function
3525
def npairs_loss(y_true: TensorLike, y_pred: TensorLike) -> tf.Tensor:
@@ -59,7 +49,6 @@ def npairs_loss(y_true: TensorLike, y_pred: TensorLike) -> tf.Tensor:
5949
Returns:
6050
npairs_loss: float scalar.
6151
"""
62-
check_if_windows("npairs_loss")
6352
y_pred = tf.convert_to_tensor(y_pred)
6453
y_true = tf.cast(y_true, y_pred.dtype)
6554

@@ -119,7 +108,6 @@ def npairs_multilabel_loss(y_true: TensorLike, y_pred: TensorLike) -> tf.Tensor:
119108
Returns:
120109
npairs_multilabel_loss: float scalar.
121110
"""
122-
check_if_windows("npairs_multilabel_loss")
123111
y_pred = tf.convert_to_tensor(y_pred)
124112
y_true = tf.cast(y_true, y_pred.dtype)
125113

tensorflow_addons/losses/tests/npairs_test.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,10 @@
1414
# ==============================================================================
1515
"""Tests for npairs loss."""
1616

17-
import platform
18-
1917
import numpy as np
20-
import pytest
2118
import tensorflow as tf
2219
from tensorflow_addons.losses import npairs
2320

24-
IS_WINDOWS = platform.system() == "Windows"
25-
26-
pytestmark = pytest.mark.skipif(
27-
IS_WINDOWS,
28-
reason="Doesn't work on Windows, see https://github.com/tensorflow/addons/issues/838",
29-
)
30-
3121

3222
def test_config():
3323
nl_obj = npairs.NpairsLoss(name="nl")

0 commit comments

Comments
 (0)