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

Function forward

axlearn/common/learner.py:671–679  ·  view source on GitHub ↗
(model_params: Nested[Tensor], *, inputs: Any)

Source from the content-addressed store, hash-verified

669 model_parameters_grad = jax.tree.map(
670 lambda compute_gradients, v: v if compute_gradients else dummy_value,
671 should_compute_gradients,
672 model_params,
673 )
674 model_parameters_no_grad = jax.tree.map(
675 lambda compute_gradients, v: dummy_value if compute_gradients else v,
676 should_compute_gradients,
677 model_params,
678 )
679 return model_parameters_grad, model_parameters_no_grad
680
681 return filtered_forward, split_params_fn
682

Callers 6

test_metrics_updateMethod · 0.85
test_no_conflictMethod · 0.85
test_live_targetsMethod · 0.85
test_forwardMethod · 0.85
check_input_batchMethod · 0.85
forward_implFunction · 0.85

Calls 1

ForwardPassClass · 0.90

Tested by 6

test_metrics_updateMethod · 0.68
test_no_conflictMethod · 0.68
test_live_targetsMethod · 0.68
test_forwardMethod · 0.68
check_input_batchMethod · 0.68
forward_implFunction · 0.68