@@ -365,7 +365,7 @@ def __call__(
365365 if getattr (self .config , "num_experts" , 1 ) > 1 :
366366 mlp_lnx , load_balance_loss , _ = self .mlp (attn_output , original_inputs = attention_lnx )
367367 if self .config .load_balance_loss_weight > 0.0 and load_balance_loss is not None :
368- self .sow ("intermediates" , "moe_lb_loss" , load_balance_loss )
368+ self .sow (nnx . Intermediate , "moe_lb_loss" , load_balance_loss )
369369 else :
370370 mlp_lnx = self .mlp (attn_output , deterministic = deterministic )
371371
@@ -381,10 +381,10 @@ def __call__(
381381 layer_output = nn .with_logical_constraint (layer_output , self .activation_axis_names )
382382
383383 if cfg .record_internal_nn_metrics :
384- self .sow ("intermediates" , "activation_mean" , jnp .mean (layer_output ))
385- self .sow ("intermediates" , "activation_stdev" , jnp .std (layer_output ))
384+ self .sow (nnx . Intermediate , "activation_mean" , jnp .mean (layer_output ))
385+ self .sow (nnx . Intermediate , "activation_stdev" , jnp .std (layer_output ))
386386 self .sow (
387- "intermediates" ,
387+ nnx . Intermediate ,
388388 "activation_fraction_zero" ,
389389 jnp .sum (layer_output == 0 ) / jnp .size (layer_output ),
390390 )
0 commit comments