class_docstr: Linear Bandit Policy to be used by LinUCB, LinTS and possibly others.
class_docstr_tok: ["Linear","Bandit","Policy","to","be","used","by","LinUCB",",","LinTS","and","possibly","others","."]
docstr: Splits the observation into global and arm observations.
docstr_tok: ["Splits","the","observation","into","global","and","arm","observations","."]
code: def _split_observation(self, observation):
      """Splits the observation into global and arm observations."""
      if self._accepts_per_arm_features:
          global_observation = observation[
              bandit_spec_utils.GLOBAL_FEATURE_KEY
          ]
          arm_observations = observation[
              bandit_spec_utils.PER_ARM_FEATURE_KEY
          ]
          if not arm_observations.shape.is_compatible_with(
              [None, self._num_actions, self._arm_context_dim]
          ):
              raise ValueError(
                  "Arm observation shape is expected to be {}. Got {}.".format(
                      [None, self._num_actions, self._arm_context_dim],
                      arm_observations.shape.as_list(),
                  )
              )
      else:
          global_observation = observation
          arm_observations = None
      return global_observation, arm_observations
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import enum
  from typing import Optional, Sequence, Text, Tuple
  import tensorflow
  import tensorflow_probability
  from tf_agents.bandits.policies import constraints
  from tf_agents.bandits.policies import linalg
  from tf_agents.bandits.specs import utils
  from tf_agents.policies import tf_policy
  from tf_agents.policies import utils
  from tf_agents.specs import tensor_spec
  from tf_agents.trajectories import policy_step
  from tf_agents.typing import types
label_desc: Use image node_id 9 for calling the LinearBanditPolicy obj's underlying member method code with example usage: obj._split_observation(observation) and returns: global_observation,  arm_observations