code: def _lengths2mask(
      lengths: torch.Tensor, seq_len: int
  ) -> torch.Tensor:
      return torch.lt(
          torch.arange(seq_len, device=lengths.device)[None, :],
          lengths[:, None].long(),
      )
  
file_path: pytorchvideo/tests/test_models_masked_multistream.py
imports: import copy
  import unittest
  import torch
  import torch.nn
  from pytorchvideo.layers import make_multilayer_perceptron, PositionalEncoding
  from pytorchvideo.models.masked_multistream import LearnMaskedDefault, LSTM, MaskedSequential, MaskedTemporalPooling, TransposeMultiheadAttention, TransposeTransformerEncoder
label_desc: Use image node_id 1 for calling a global function with example usage: _lengths2mask(lengths, seq_len) and returns: torch