class_docstr: This tests the model (not trainer) of DeepRepresentLinUCB.
class_docstr_tok: ["This","tests","the","model","(","not","trainer",")","of","DeepRepresentLinUCB","."]
code: def test_basic(self):
      input_dim = 9
      sizes = [6]
      linucb_inp_dim = 3
      activations = ["relu", "relu"]
      output_activation = "sigmoid"
  
      model = DeepRepresentLinearRegressionUCB(
          input_dim=input_dim,
          sizes=sizes + [linucb_inp_dim],
          activations=activations,
          output_activation=output_activation,
      )
  
      batch_size = 150
      raw_input = torch.randn(batch_size, input_dim)
      self.assertEqual(
          (
              batch_size,
              linucb_inp_dim,
          ),  # check deep_represent output size
          model.deep_represent_layers(raw_input).shape,
      )
      model.eval()
      model_output = model(raw_input)
  
      # check that model's all outputs can be computed
      pred_label = model_output["pred_label"]  # noqa
      pred_sigma = model_output["pred_sigma"]  # noqa
      ucb = model_output["ucb"]
      mlp_out_with_ones = model_output["mlp_out_with_ones"]  # noqa
  
      self.assertEqual(
          (batch_size,), ucb.shape
      )  # ucb is 1-d tensor of same batch size as input
  
      self.assertEqual(
          (batch_size,), pred_sigma.shape
      )  # pred_sigma is 1-d tensor of same batch size as input
  
      self.assertEqual(
          (batch_size,), pred_label.shape
      )  # pred_label is 1-d tensor of same batch size as input
  
      self.assertTrue(
          (ucb >= 0.0).all() and (ucb <= 1.0).all()
      )  # model output in [0;1] because of sigmoid activation
      self.assertTrue(
          (pred_label >= 0.0).all() and (pred_label <= 1.0).all()
      )
  
imports: import unittest
  import torch
  from reagent.models.deep_represent_linucb import DeepRepresentLinearRegressionUCB
label_desc: Use image node_id 1 for calling the TestDeepRepresentLinearRegressionUCB obj's underlying member method code with example usage: obj.test_basic() without return types