find_hidden_param_op_relations_from_module#
- class braintrace.find_hidden_param_op_relations_from_module(model, *model_args, **model_kwargs)[source]#
Find ETP relations from a model.
- Parameters:
model (
Module) – The model.*model_args – The positional arguments of the model.
**model_kwargs – The keyword arguments of the model.
- Returns:
The discovered ETP-primitive-to-hidden-state relations.
- Return type:
See also
find_hidden_param_op_relations_from_minfoEquivalent helper starting from
ModuleInfo.
Examples
>>> import brainstate >>> import braintrace >>> gru = braintrace.nn.GRUCell(3, 4) >>> _ = brainstate.nn.init_all_states(gru) >>> inputs = brainstate.random.randn(3) >>> relations = braintrace.find_hidden_param_op_relations_from_module(gru, inputs) >>> len(relations) 2