class_docstr: An agent that maintains linear reward estimates and their uncertainties.
class_docstr_tok: ["An","agent","that","maintains","linear","reward","estimates","and","their","uncertainties","."]
code: def compute_summaries(self, loss: types.Tensor):
      if self.summaries_enabled:
          with tf.name_scope("Losses/"):
              tf.compat.v2.summary.scalar(
                  name="loss", data=loss, step=self.train_step_counter
              )
  
          if self._summarize_grads_and_vars:
              with tf.name_scope("Variables/"):
                  for var in self.policy.variables():
                      var_name = var.name.replace(":", "_")
                      tf.compat.v2.summary.histogram(
                          name=var_name,
                          data=var,
                          step=self.train_step_counter,
                      )
                      tf.compat.v2.summary.scalar(
                          name=var_name + "_value_norm",
                          data=tf.linalg.global_norm([var]),
                          step=self.train_step_counter,
                      )
              if self._add_bias:
                  thetas = self.theta
                  biases = thetas[:, self._global_context_dim - 1]
                  bias_list = tf.unstack(biases, axis=0)
                  for i in range(self._num_actions):
                      tf.compat.v2.summary.scalar(
                          name="bias/action_" + str(i),
                          data=bias_list[i],
                          step=self.train_step_counter,
                      )
  
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 gin
  import tensorflow
  from tf_agents.agents import data_converter
  from tf_agents.agents import tf_agent
  from tf_agents.bandits.agents import utils
  from tf_agents.bandits.policies import linalg
  from tf_agents.bandits.policies import linear_bandit_policy
  from tf_agents.bandits.specs import utils
  from tf_agents.policies import utils
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 12 for calling the LinearBanditAgent obj's underlying member method code with example usage: obj.compute_summaries(loss) without return types