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

Function count_model_params

axlearn/common/utils.py:1331–1333  ·  view source on GitHub ↗

Count the number of parameters in a model.

(tree: NestedTensor)

Source from the content-addressed store, hash-verified

1329 cast_fn = per_param_dtype_by_path(default_dtype, update_rules)
1330 per_param_dtype = cast_fn(tree)
1331 Result:
1332 per_param_dtype = {
1333 'conv1_weights': jnp.float32,
1334 'conv2_weights': jnp.float32,
1335 'fc1_weights': jnp.bfloat16,
1336 'fc2_weights': jnp.bfloat16,

Calls

no outgoing calls