Skip to content

Commit 208194f

Browse files
lorenrose1013Google-ML-Automation
authored andcommitted
context manager methods for AbstractMesh to appease type checker.
PiperOrigin-RevId: 702890537
1 parent 3990e05 commit 208194f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

jax/_src/mesh.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,12 @@ def local_devices(self):
454454
def local_mesh(self):
455455
_raise_value_error("local_mesh")
456456

457+
def __enter__(self):
458+
_raise_value_error("__enter__")
459+
460+
def __exit__(self, exc_type, exc_value, traceback):
461+
_raise_value_error("__exit__")
462+
457463
@staticmethod
458464
def _extremely_unsafe_enter_tracing_context(mesh: AbstractMesh):
459465
jax_config.abstract_mesh_context_manager.set_local(mesh)

0 commit comments

Comments
 (0)