code: def test_task_incremental_bm_basic(self):
      d1 = AvalancheDataset(dummy_tensor_dataset())
      d2 = AvalancheDataset(dummy_tensor_dataset())
      bm = benchmark_from_datasets(train=[d1, d2])
      bm = task_incremental_benchmark(bm)
      # check task labels attributes and dataset lengths
      s = bm.train_stream
      assert s[0].task_label == 0
      assert len(s[0].dataset) == len(d1)
      assert s[1].task_label == 1
      assert len(s[1].dataset) == len(d2)
  
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 TaskIncrementalScenarioTests obj's underlying member method code with example usage: obj.test_task_incremental_bm_basic() without return types