MCPcopy Create free account
hub / github.com/apple/axlearn / is_supported_platform

Function is_supported_platform

axlearn/common/test_utils.py:106–116  ·  view source on GitHub ↗

Checks if a function intended for a specific platform can be executed on the current one.

(target_platform: str)

Source from the content-addressed store, hash-verified

104
105
106def is_supported_platform(target_platform: str) -> bool:
107 """Checks if a function intended for a specific platform can be executed on the current one."""
108 devices = jax.devices()
109 supported = all(device.platform == target_platform for device in devices)
110 if not supported:
111 logging.info(
112 "Skipping test for %s on %s",
113 target_platform,
114 [device.platform for device in devices],
115 )
116 return supported
117
118
119def is_supported_mesh_shape(

Callers 1

_is_supportedFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected