code: def test_get_chunk(self):
      # dimensions: (batch_size, sequence_length, feature_dimension)
      start, step = 0, 2
      batch_size, seq_len, feat_dim = 10, 5, 2
  
      input_tensor = torch.rand(batch_size, seq_len, feat_dim)
      len_tensor = torch.zeros(batch_size).fill_(seq_len)
      data, target, lengths = get_chunk(
          input_tensor, len_tensor, start, step
      )
  
      # check length vector is correct
      assert lengths.shape[0] == batch_size
      assert lengths.numpy()[0] == seq_len - 1
  
      # check data and target
      chunk_size = min(start + step, batch_size) - start
      assert data.shape == (batch_size, chunk_size, feat_dim)
      assert target.shape == (batch_size, chunk_size, feat_dim)
      assert torch.equal(data[:, 1, :], target[:, 0, :])
  
      # check edge case: correct cutoff at end of sequence
      start, step = 2, 4
      chunk_size = (
          min(start + step, seq_len) - start - 1
      )  # -1 because of cut off
      data, target, lengths = get_chunk(
          input_tensor, len_tensor, start, step
      )
      assert data.shape == (batch_size, chunk_size, feat_dim)
      assert target.shape == (batch_size, chunk_size, feat_dim)
  
file_path: lightwood/tests/unit_tests/encoder/time_series/test_transformer.py
imports: import copy
  import logging
  import torch
  import unittest
  from lightwood.encoder.time_series.rnn import TimeSeriesEncoder
  from lightwood.encoder.time_series.helpers.transformer_helpers import TransformerEncoder, len_to_mask, get_chunk
  import pandas
label_desc: Use image node_id 1 for calling the TestTransformerEncoder obj's underlying member method code with example usage: obj.test_get_chunk() without return types