ray.rllib.utils.tf_utils.zero_logps_from_actions(actions: numpy.array | jnp.ndarray | tf.Tensor | torch.Tensor | dict | tuple) numpy.array | jnp.ndarray | tf.Tensor | torch.Tensor[source]#

Helper function useful for returning dummy logp’s (0) for some actions.


actions – The input actions. This can be any struct of complex action components or a simple tensor of different dimensions, e.g. [B], [B, 2], or {“a”: [B, 4, 5], “b”: [B]}.


A 1D tensor of 0.0 (dummy logp’s) matching the batch dim of actions (shape=[B]).