Skip to content

Commit f581148

Browse files
yileicopybara-github
authored andcommitted
Make this code compatible with Python 3.10.
PiperOrigin-RevId: 475415367
1 parent f0c4c92 commit f581148

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tensorflow_graphics/projects/gan/losses.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414
"""Module with loss functions."""
1515

16-
import collections
16+
from collections import abc
1717
from typing import Sequence, Union
1818

1919
import tensorflow as tf
@@ -65,8 +65,8 @@ def gradient_penalty_loss(real_data: Union[tf.Tensor, Sequence[tf.Tensor]],
6565
dtype=real_data.dtype)
6666
interpolated_data = epsilon * real_data + (1.0 -
6767
epsilon) * generated_data
68-
elif (isinstance(real_data, collections.Sequence) and
69-
isinstance(generated_data, collections.Sequence)):
68+
elif (isinstance(real_data, abc.Sequence) and
69+
isinstance(generated_data, abc.Sequence)):
7070
if len(real_data) != len(generated_data):
7171
raise ValueError(
7272
'The number of elements in real_data and generated_data are '

0 commit comments

Comments
 (0)