Skip to content
This repository was archived by the owner on Jan 21, 2025. It is now read-only.

Commit bbb6ce7

Browse files
yileiMesh TensorFlow Team
authored andcommitted
Use math.gcd instead of fractions.gcd, the former is deprecated in Python 3.5 and removed in 3.9.
PiperOrigin-RevId: 424259166
1 parent ead60ee commit bbb6ce7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mesh_tensorflow/auto_mtf/valid_layouts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
from __future__ import division
2828
from __future__ import print_function
2929

30-
import fractions
30+
import math
3131
import re
3232

3333

@@ -132,7 +132,7 @@ def _initialize_mtf_dimension_name_to_size_gcd(self, mtf_graph):
132132
for mtf_operation in mtf_graph.operations:
133133
for mtf_tensor in mtf_operation.outputs:
134134
for mtf_dimension in mtf_tensor.shape.dims:
135-
mtf_dimension_name_to_size_gcd[mtf_dimension.name] = fractions.gcd(
135+
mtf_dimension_name_to_size_gcd[mtf_dimension.name] = math.gcd(
136136
mtf_dimension_name_to_size_gcd.get(mtf_dimension.name,
137137
mtf_dimension.size),
138138
mtf_dimension.size)

0 commit comments

Comments
 (0)