class_docstr: Computes PWIL rewards along a trajectory.
  
  The rewards measure similarity to the demonstration transitions and are based
  on a greedy approximation to the Wasserstein distance between trajectories.
docstr: Converts filtered expert demonstrations to numpy array.
  
  Args:
    demonstrations_it: list of expert demonstrations
  
  Returns:
    numpy array with dimension:
    [num_expert_transitions, dim_observation] if not use_actions_for_distance
    [num_expert_transitions, (dim_observation + dim_action)] otherwise
code: def _vectorize(
      self, demonstrations_it: Iterator[types.Transition]
  ) -> np.ndarray:
      """Converts filtered expert demonstrations to numpy array.
  
      Args:
        demonstrations_it: list of expert demonstrations
  
      Returns:
        numpy array with dimension:
        [num_expert_transitions, dim_observation] if not use_actions_for_distance
        [num_expert_transitions, (dim_observation + dim_action)] otherwise
      """
      if self._use_actions_for_distance:
          demonstrations = [
              np.concatenate([t.observation, t.action])
              for t in demonstrations_it
          ]
      else:
          demonstrations = [t.observation for t in demonstrations_it]
      return np.array(demonstrations)
  
file_path: acme/acme/agents/jax/pwil/rewarder.py
imports: from typing import Iterator
  from acme import types
  import jax
  import jax.numpy
  import numpy
label_desc: Use image node_id 2 for calling the WassersteinDistanceRewarder obj's underlying member method code with example usage: obj._vectorize(demonstrations_it) and returns: np