code: def test_gstg_1d_input_with_mask(self) -> None:
      dim = 2
      mask = torch.tensor([0, 0, 1]).to(self.testing_device)
      gstg = GaussianStochasticGates(dim, mask=mask).to(
          self.testing_device
      )
      input_tensor = torch.tensor(
          [
              [0.0, 0.1, 0.2],
              [0.3, 0.4, 0.5],
          ]
      ).to(self.testing_device)
  
      gated_input, reg = gstg(input_tensor)
      expected_reg = 1.6849
  
      if self.testing_device == "cpu":
          expected_gated_input = [
              [0.0000, 0.0000, 0.1225],
              [0.0583, 0.0777, 0.3779],
          ]
      elif self.testing_device == "cuda":
          expected_gated_input = [
              [0.0000, 0.0000, 0.1577],
              [0.0736, 0.0981, 0.0242],
          ]
  
      assertTensorAlmostEqual(
          self, gated_input, expected_gated_input, mode="max"
      )
      assertTensorAlmostEqual(self, reg, expected_reg)
  
imports: import unittest
  import torch
  from captum.module.gaussian_stochastic_gates import GaussianStochasticGates
  from parameterized import parameterized_class
  from tests.helpers.basic import assertTensorAlmostEqual, BaseTest
label_desc: Use image node_id 5 for calling the TestGaussianStochasticGates obj's underlying member method code with example usage: obj.test_gstg_1d_input_with_mask() without return types