code: def test_masked_multistream_model(self):
      feature_dim = 8
      mlp, out_dim = make_multilayer_perceptron([feature_dim, 2])
      input_stream = MaskedSequential(
          PositionalEncoding(feature_dim),
          TransposeMultiheadAttention(feature_dim),
          MaskedTemporalPooling(method="avg"),
          torch.nn.LayerNorm(feature_dim),
          mlp,
          LearnMaskedDefault(out_dim),
      )
  
      seq_len = 10
      input_tensor = torch.rand([4, seq_len, feature_dim])
      mask = _lengths2mask(
          torch.tensor([seq_len, seq_len, seq_len, seq_len]),
          input_tensor.shape[1],
      )
      output = input_stream(input=input_tensor, mask=mask)
      self.assertEqual(output.shape, torch.Size([4, out_dim]))
  
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 2 for calling the TestMaskedMultiStream obj's underlying member method code with example usage: obj.test_masked_multistream_model() without return types