class_docstr: Optimal policy for PointEnv.
  
  Args:
      env_spec (EnvSpec): The environment spec.
      goal (np.ndarray): The goal location of the environment.
class_docstr_tok: ["Optimal","policy","for","PointEnv",".","Args",":","env_spec","(","EnvSpec",")",":","The","environment","spec",".","goal","(","np.ndarray",")",":","The","goal","location","of","the","environment","."]
docstr: Get actions given observations.
  
  Args:
      observations (np.ndarray): Observations from the environment.
          Has shape :math:`(B, O)`, where :math:`B` is the batch
          dimension and :math:`O` is the observation dimensionality (at
          least 2).
  
  Returns:
      tuple:
          * np.ndarray: Batch of optimal actions.
              Has shape :math:`(B, 2)`, where :math:`B` is the batch
              dimension.
          Optimal action in the environment.
          * dict[str, np.ndarray]: Agent info (empty).
docstr_tok: ["Get","actions","given","observations",".","Args",":","observations","(","np.ndarray",")",":","Observations","from","the","environment",".","Has","shape",":","math",":","`","(","B",",","O",")","`",",","where",":","math",":","`","B","`","is","the","batch","dimension","and",":","math",":","`","O","`","is","the","observation","dimensionality","(","at","least","2",")",".","Returns",":","tuple",":","*","np.ndarray",":","Batch","of","optimal","actions",".","Has","shape",":","math",":","`","(","B",",","2",")","`",",","where",":","math",":","`","B","`","is","the","batch","dimension",".","Optimal","action","in","the","environment",".","*","dict","[","str",",","np.ndarray","]",":","Agent","info","(","empty",")","."]
code: def get_actions(self, observations):
      """Get actions given observations.
  
      Args:
          observations (np.ndarray): Observations from the environment.
              Has shape :math:`(B, O)`, where :math:`B` is the batch
              dimension and :math:`O` is the observation dimensionality (at
              least 2).
  
      Returns:
          tuple:
              * np.ndarray: Batch of optimal actions.
                  Has shape :math:`(B, 2)`, where :math:`B` is the batch
                  dimension.
              Optimal action in the environment.
              * dict[str, np.ndarray]: Agent info (empty).
  
      """
      return (
          self.goal[np.newaxis, :].repeat(len(observations), axis=0)
          - observations[:, :2]
      ), {}
  
file_path: garage/tests/garage/torch/algos/test_bc.py
imports: import numpy
  import ray
  from garage.envs import PointEnv
  from garage.experiment import deterministic
  from garage.sampler import LocalSampler, WorkerFactory
  from garage.torch.algos import BC
  from garage.torch.policies import DeterministicMLPPolicy, GaussianMLPPolicy, Policy
  from garage.trainer import Trainer
  from tests.fixtures import snapshot_config
  from tests.fixtures.sampler import ray_local_session_fixture
label_desc: Use image node_id 3 for calling the OptimalPolicy obj's underlying member method code with example usage: obj.get_actions(observations) and returns: unknown,  dict