code: def testLastBatchMode(self):
      # Test that the algorithm pushes an incomplete patch.
      frame_size, patch_size, batch_size = 1, 3, 3
      shape = [batch_size, 1, patch_size, frame_size]
  
      # 1 complete batch plus 2 patches.
      extra_patches = 2
      n_samples = (batch_size + extra_patches) * (
          patch_size * frame_size
      )
  
      for last_patch_model in ("repeat", "discard"):
          params = {
              "shape": shape,
              "lastPatchMode": last_patch_model,
              "lastBatchMode": "push",
          }
  
          batches = self.streamingPipeline(n_samples, params)
  
          # In `push` mode we expect two patches.
          expected_n_batches = 2
          self.assertEqual(len(batches), expected_n_batches)
  
          # The first one should be complete.
          expected_shape_first = [batch_size, 1, patch_size, frame_size]
          self.assertEqualVector(batches[0].shape, expected_shape_first)
  
          # The second one should contain just two patches.
          expected_shape_second = [
              extra_patches,
              1,
              patch_size,
              frame_size,
          ]
          self.assertEqualVector(
              batches[1].shape, expected_shape_second
          )
  
      for last_patch_model in ("repeat", "discard"):
          params = {
              "shape": shape,
              "lastPatchMode": last_patch_model,
              "lastBatchMode": "discard",
          }
  
          batches = self.streamingPipeline(n_samples, params)
  
          # In `discard` mode we expect a single complete batch.
          expected_n_batches = 1
          self.assertEqual(len(batches), expected_n_batches)
  
          # It should be complete.
          expected_shape_first = [batch_size, 1, patch_size, frame_size]
          self.assertEqualVector(batches[0].shape, expected_shape_first)
  
file_path: essentia/test/src/unittests/streaming/test_vectorrealtotensor.py
imports: from essentia_test import *
  from essentia.streaming import *
label_desc: Use image node_id 11 for calling the TestVectorRealToTensor obj's underlying member method code with example usage: obj.testLastBatchMode() without return types