docstr: Tests, SampleBatches.concat() and concat_samples().
docstr_tok: ["Tests",",","SampleBatches.concat","(",")","and","concat_samples","(",")","."]
code: def test_concat(self):
      """Tests, SampleBatches.concat() and concat_samples()."""
      s1 = SampleBatch(
          {
              "a": np.array([1, 2, 3]),
              "b": {"c": np.array([4, 5, 6])},
          }
      )
      s2 = SampleBatch(
          {
              "a": np.array([2, 3, 4]),
              "b": {"c": np.array([5, 6, 7])},
          }
      )
      concatd = concat_samples([s1, s2])
      check(concatd["a"], [1, 2, 3, 2, 3, 4])
      check(concatd["b"]["c"], [4, 5, 6, 5, 6, 7])
      check(next(concatd.rows()), {"a": 1, "b": {"c": 4}})
  
      concatd_2 = s1.concat(s2)
      check(concatd, concatd_2)
  
imports: import copy
  import functools
  import os
  import unittest
  import numpy
  import torch
  import tree
  import ray
  from ray.rllib.models.repeated_values import RepeatedValues
  from ray.rllib.policy.sample_batch import SampleBatch, attempt_count_timesteps, concat_samples
  from ray.rllib.utils.compression import is_compressed
  from ray.rllib.utils.framework import try_import_torch
  from ray.rllib.utils.test_utils import check
  from ray.rllib.utils.torch_utils import convert_to_torch_tensor
label_desc: Use image node_id 6 for calling the TestSampleBatch obj's underlying member method code with example usage: obj.test_concat() without return types