code: def test_masked_temporal_pooling(self):
      fake_input = torch.Tensor(
          [[[4, -2], [3, 0]], [[0, 2], [4, 3]], [[3, 1], [5, 2]]]
      ).float()
      valid_lengths = torch.Tensor([2, 1, 0]).int()
      valid_mask = _lengths2mask(valid_lengths, fake_input.shape[1])
      expected_output_for_method = {
          "max": torch.Tensor([[4, 0], [0, 2], [0, 0]]).float(),
          "avg": torch.Tensor([[3.5, -1], [0, 2], [0, 0]]).float(),
          "sum": torch.Tensor([[7, -2], [0, 2], [0, 0]]).float(),
      }
      for method, expected_output in expected_output_for_method.items():
          model = MaskedTemporalPooling(method)
          output = model(copy.deepcopy(fake_input), mask=valid_mask)
          self.assertTrue(torch.equal(output, expected_output))
  
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 3 for calling the TestMaskedMultiStream obj's underlying member method code with example usage: obj.test_masked_temporal_pooling() without return types