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: Helper function to construct the observation for a specific arm.
  
  This function constructs the observation depending if the policy accepts
  per-arm features or not. If not, it simply returns the original observation.
  If yes, it concatenates the global observation with the observation of the
  arm indexed by `arm_index`.
  
  Args:
    global_observation: A tensor of shape `[batch_size, global_context_dim]`.
      The global part of the observation.
    arm_observations: A tensor of shape `[batch_size, num_actions,
      arm_context_dim]`. The arm part of the observation, for all arms. If the
      policy does not accept per-arm features, this paramater is unused.
    arm_index: (int) The arm for which the observations to be returned.
  
  Returns:
    A tensor of shape `[batch_size, overall_context_dim]`, containing the
    observation for arm `arm_index`.
docstr_tok: ["Helper","function","to","construct","the","observation","for","a","specific","arm",".","This","function","constructs","the","observation","depending","if","the","policy","accepts","per-arm","features","or","not",".","If","not",",","it","simply","returns","the","original","observation",".","If","yes",",","it","concatenates","the","global","observation","with","the","observation","of","the","arm","indexed","by","`","arm_index","`",".","Args",":","global_observation",":","A","tensor","of","shape","`","[","batch_size",",","global_context_dim","]","`",".","The","global","part","of","the","observation",".","arm_observations",":","A","tensor","of","shape","`","[","batch_size",",","num_actions",",","arm_context_dim","]","`",".","The","arm","part","of","the","observation",",","for","all","arms",".","If","the","policy","does","not","accept","per-arm","features",",","this","paramater","is","unused",".","arm_index",":","(","int",")","The","arm","for","which","the","observations","to","be","returned",".","Returns",":","A","tensor","of","shape","`","[","batch_size",",","overall_context_dim","]","`",",","containing","the","observation","for","arm","`","arm_index","`","."]
code: def _get_current_observation(
      self, global_observation, arm_observations, arm_index
  ):
      """Helper function to construct the observation for a specific arm.
  
      This function constructs the observation depending if the policy accepts
      per-arm features or not. If not, it simply returns the original observation.
      If yes, it concatenates the global observation with the observation of the
      arm indexed by `arm_index`.
  
      Args:
        global_observation: A tensor of shape `[batch_size, global_context_dim]`.
          The global part of the observation.
        arm_observations: A tensor of shape `[batch_size, num_actions,
          arm_context_dim]`. The arm part of the observation, for all arms. If the
          policy does not accept per-arm features, this paramater is unused.
        arm_index: (int) The arm for which the observations to be returned.
  
      Returns:
        A tensor of shape `[batch_size, overall_context_dim]`, containing the
        observation for arm `arm_index`.
      """
      if self._accepts_per_arm_features:
          current_arm = arm_observations[:, arm_index, :]
          current_observation = tf.concat(
              [global_observation, current_arm], axis=-1
          )
          return current_observation
      else:
          return global_observation
  
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 8 for calling the LinearBanditPolicy obj's underlying member method code with example usage: obj._get_current_observation(global_observation, arm_observations, arm_index) and returns: current_observation, global_observation