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

Function cast

axlearn/common/utils.py:1164–1170  ·  view source on GitHub ↗
(x: Union[Tensor, TensorSpec])

Source from the content-addressed store, hash-verified

1162 prefix = separator.join(path[: idx + 1]) if separator and is_str else path[: idx + 1]
1163 raise KeyError(f"No entries found at path '{prefix}'")
1164 x = x[key]
1165
1166 return x
1167
1168
1169def set_recursively(
1170 x: NestedTensor,
1171 *,
1172 value: Tensor,
1173 path: Union[str, Sequence[str]],

Callers 15

test_instantiateMethod · 0.85
test_instantiateMethod · 0.85
test_instantiateMethod · 0.85
_get_flink_job_statusMethod · 0.85
_docker_bundler_to_flagsFunction · 0.85
trainer_configsFunction · 0.85
alignMethod · 0.85
test_aux_loss_learnerMethod · 0.85

Calls 2

replaceMethod · 0.80
astypeMethod · 0.80

Tested by 11

test_instantiateMethod · 0.68
test_instantiateMethod · 0.68
test_instantiateMethod · 0.68
test_aux_loss_learnerMethod · 0.68
initMethod · 0.68
test_reshape_devicesMethod · 0.68
create_corrupt_ckptMethod · 0.68