code: def test_linucb_weights(self):
      # make sure that using a weight is same as processing an example several times
      batch_with_weight = copy.deepcopy(self.batch)
      for arm in range(self.num_arms):
          batch_with_weight[arm].weight = 3 * torch.ones(
              (self.batch_size, 1)
          )
  
      scorer_1 = DisjointLinearRegressionUCB(self.num_arms, self.x_dim)
      scorer_2 = DisjointLinearRegressionUCB(self.num_arms, self.x_dim)
      policy_1 = Policy(scorer=scorer_1, sampler=GreedyActionSampler())
      policy_2 = Policy(scorer=scorer_2, sampler=GreedyActionSampler())
      trainer_1 = DisjointLinUCBTrainer(policy_1)
      trainer_2 = DisjointLinUCBTrainer(policy_2)
  
      trainer_1.training_step(batch_with_weight, 0)
      trainer_1.on_train_epoch_end()
      for i in range(3):
          trainer_2.training_step(self.batch, i)
      trainer_2.on_train_epoch_end()
  
      for arm in range(self.num_arms):
          npt.assert_array_less(
              np.zeros(scorer_1.A[arm].shape), scorer_1.A[arm].numpy()
          )  # make sure A got updated
      npt.assert_allclose(
          scorer_1.A.numpy(), scorer_2.A.numpy(), rtol=1e-6
      )
      npt.assert_allclose(
          scorer_1.b.numpy(), scorer_2.b.numpy(), rtol=1e-6
      )
  
file_path: ReAgent/reagent/test/training/cb/test_disjoint_linucb.py
imports: import copy
  import unittest
  import numpy
  import numpy.testing
  import torch
  from reagent.core.types import CBInput
  from reagent.gym.policies.policy import Policy
  from reagent.gym.policies.samplers.discrete_sampler import GreedyActionSampler
  from reagent.models.disjoint_linucb_predictor import DisjointLinearRegressionUCB
  from reagent.training.cb.disjoint_linucb_trainer import DisjointLinUCBTrainer
  from reagent.training.parameters import DisjointLinUCBTrainerParameters
label_desc: Use image node_id 5 for calling the TestDisjointLinUCB obj's underlying member method code with example usage: obj.test_linucb_weights() without return types