Skip to content

Commit

Permalink
Remove the deprecated `tf.keras.dtensor.experimental.layout_map_scope…
Browse files Browse the repository at this point in the history
…` API.

The deprecated warning was showing up when using the `LayoutMap.scope`, which is confusing to end user.

PiperOrigin-RevId: 526818762
  • Loading branch information
qlzh727 authored and tensorflower-gardener committed Apr 25, 2023
1 parent ed008ff commit 08f9b1a
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@ tf_module {
name: "optimizers"
mtype: "<type \'module\'>"
}
member_method {
name: "layout_map_scope"
argspec: "args=[], varargs=args, keywords=kwds, defaults=None"
}
}
5 changes: 0 additions & 5 deletions keras/dtensor/layout_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
from keras.engine import base_layer

# isort: off
from tensorflow.python.util.deprecation import deprecated
from tensorflow.python.util.tf_export import keras_export


Expand Down Expand Up @@ -235,10 +234,6 @@ def call(self, inputs):
LayoutMap.get.__doc__ = LayoutMap.__getitem__.__doc__


@keras_export("keras.dtensor.experimental.layout_map_scope", v1=[])
@deprecated(
None, "use tf.keras.dtensor.experimental.LayoutMap.scope() instead."
)
@contextlib.contextmanager
def layout_map_scope(layout_map):
"""Apply the layout to all the tf.Variables created under the scope.
Expand Down
2 changes: 1 addition & 1 deletion keras/dtensor/layout_map_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def test_init_model_with_empty_layout_map(self):

def test_weight_regularization(self):
layout_map = layout_map_lib.LayoutMap(mesh=self.mesh)
with layout_map_lib.layout_map_scope(layout_map):
with layout_map.scope():
model = models.Sequential(
[
layers.Dense(
Expand Down

0 comments on commit 08f9b1a

Please sign in to comment.