class_docstr_tok: []
code: def test_ms_pair_batch(self):
      x = torch.tensor([1])
      pos = x
      x_target = torch.tensor([2])
      pos_target = x
      ms = [Data(x=x, pos=pos), Data(x=4 * x, pos=4 * pos)]
      ms_target = [
          Data(x=x_target, pos=pos_target),
          Data(x=4 * x_target, pos=4 * pos_target),
      ]
      data1 = MultiScalePair(
          x=x,
          pos=pos,
          multiscale=ms,
          x_target=x_target,
          pos_target=pos_target,
          multiscale_target=ms_target,
      )
  
      x = torch.tensor([3])
      pos = x
      x_target = torch.tensor([4])
      pos_target = x
      ms = [Data(x=x, pos=pos), Data(x=4 * x, pos=4 * pos)]
      ms_target = [
          Data(x=x_target, pos=pos_target),
          Data(x=4 * x_target, pos=4 * pos_target),
      ]
      data2 = MultiScalePair(
          x=x,
          pos=pos,
          multiscale=ms,
          x_target=x_target,
          pos_target=pos_target,
          multiscale_target=ms_target,
      )
  
      batch = PairMultiScaleBatch.from_data_list([data1, data2])
      tt.assert_allclose(batch.x, torch.tensor([1, 3]))
      tt.assert_allclose(batch.x_target, torch.tensor([2, 4]))
      tt.assert_allclose(batch.batch, torch.tensor([0, 1]))
      tt.assert_allclose(batch.batch_target, torch.tensor([0, 1]))
  
      ms_batches = batch.multiscale
      tt.assert_allclose(ms_batches[0].batch, torch.tensor([0, 1]))
      tt.assert_allclose(ms_batches[1].batch, torch.tensor([0, 1]))
      tt.assert_allclose(ms_batches[1].x, torch.tensor([4, 12]))
  
      ms_batches = batch.multiscale_target
      tt.assert_allclose(ms_batches[0].batch, torch.tensor([0, 1]))
      tt.assert_allclose(ms_batches[1].batch, torch.tensor([0, 1]))
      tt.assert_allclose(ms_batches[1].x, torch.tensor([8, 16]))
  
file_path: torch-points3d/test/test_msdatapair.py
imports: import unittest
  import torch
  import torch.testing
  from torch_geometric.data import Data
  import numpy.testing
  from torch_points3d.datasets.registration.pair import Pair, MultiScalePair, PairBatch, PairMultiScaleBatch
label_desc: Use image node_id 3 for calling the TestMSPair obj's underlying member method code with example usage: obj.test_ms_pair_batch() without return types