ray.rllib.models.modelv2.ModelV2.trainable_variables
ray.rllib.models.modelv2.ModelV2.trainable_variables#
- ModelV2.trainable_variables(as_dict: bool = False) Union[List[Union[numpy.array, jnp.ndarray, tf.Tensor, torch.Tensor]], Dict[str, Union[numpy.array, jnp.ndarray, tf.Tensor, torch.Tensor]]] [source]#
Returns the list of trainable variables for this model.
- Parameters
as_dict – Whether variables should be returned as dict-values (using descriptive keys).
- Returns
The list (or dict if
as_dict
is True) of all trainable (tf)/requires_grad (torch) variables of this ModelV2.