code: def test_benchmark_with_validation_stream_fixed_size(self):
      pattern_shape = (3, 32, 32)
  
      # Definition of training experiences
      # Experience 1
      experience_1_x = torch.zeros(100, *pattern_shape)
      experience_1_y = torch.zeros(100, dtype=torch.long)
      d1 = TensorDataset(experience_1_x, experience_1_y)
      d1 = AvalancheDataset([d1])
      # Experience 2
      experience_2_x = torch.zeros(80, *pattern_shape)
      experience_2_y = torch.ones(80, dtype=torch.long)
      d2 = TensorDataset(experience_2_x, experience_2_y)
      d2 = AvalancheDataset([d2])
  
      # Test experience
      test_x = torch.zeros(50, *pattern_shape)
      test_y = torch.zeros(50, dtype=torch.long)
      dtest = TensorDataset(test_x, test_y)
      dtest = AvalancheDataset(dtest)
  
      bm = benchmark_from_datasets(train=[d1, d2], test=[dtest])
      valid_bm = benchmark_with_validation_stream(bm, 20, shuffle=False)
  
      self.assertEqual(2, len(valid_bm.train_stream))
      self.assertEqual(2, len(valid_bm.valid_stream))
      self.assertEqual(1, len(valid_bm.test_stream))
  
      self.assertEqual(80, len(valid_bm.train_stream[0].dataset))
      self.assertEqual(60, len(valid_bm.train_stream[1].dataset))
      self.assertEqual(20, len(valid_bm.valid_stream[0].dataset))
      self.assertEqual(20, len(valid_bm.valid_stream[1].dataset))
  
      vd = valid_bm.train_stream[0].dataset
      mb = get_mbatch(vd, len(vd))
      self.assertTrue(torch.equal(experience_1_x[:80], mb[0]))
      self.assertTrue(torch.equal(experience_1_y[:80], mb[1]))
  
      vd = valid_bm.train_stream[1].dataset
      mb = get_mbatch(vd, len(vd))
      self.assertTrue(torch.equal(experience_2_x[:60], mb[0]))
      self.assertTrue(torch.equal(experience_2_y[:60], mb[1]))
  
      vd = valid_bm.valid_stream[0].dataset
      mb = get_mbatch(vd, len(vd))
      self.assertTrue(torch.equal(experience_1_x[80:], mb[0]))
      self.assertTrue(torch.equal(experience_1_y[80:], mb[1]))
  
      vd = valid_bm.valid_stream[1].dataset
      mb = get_mbatch(vd, len(vd))
      self.assertTrue(torch.equal(experience_2_x[60:], mb[0]))
      self.assertTrue(torch.equal(experience_2_y[60:], mb[1]))
  
      vd = valid_bm.test_stream[0].dataset
      mb = get_mbatch(vd, len(vd))
      self.assertTrue(torch.equal(test_x, mb[0]))
      self.assertTrue(torch.equal(test_y, mb[1]))
  
imports: import unittest
  import torch
  from numpy.testing import assert_almost_equal
  from torch.utils.data import TensorDataset, DataLoader
  from avalanche.benchmarks import benchmark_from_datasets, benchmark_with_validation_stream, CLScenario, CLStream, split_validation_random, task_incremental_benchmark
  from avalanche.benchmarks.scenarios.dataset_scenario import DatasetExperience, split_validation_class_balanced
  from avalanche.benchmarks.utils import AvalancheDataset
  from tests.unit_tests_utils import dummy_tensor_dataset, get_fast_benchmark, DummyImageDataset
label_desc: Use image node_id 1 for calling the DatasetWithValidationStreamTests obj's underlying member method code with example usage: obj.test_benchmark_with_validation_stream_fixed_size() without return types