code: def test_sequential_gaussian_filter_sample_antithetic(
      sample_shape, batch_shape, state_dim, num_steps
  ):
      init = random_gaussian(batch_shape, state_dim)
      trans = random_gaussian(
          batch_shape + (num_steps,), state_dim + state_dim
      )
      duration = 1 + num_steps
  
      noise = torch.randn(
          sample_shape + batch_shape + (duration, state_dim)
      )
      zero = torch.zeros_like(noise)
      sample = sequential_gaussian_filter_sample(
          init, trans, sample_shape, noise
      )
      mean = sequential_gaussian_filter_sample(
          init, trans, sample_shape, zero
      )
      assert sample.shape == sample_shape + batch_shape + (
          duration,
          state_dim,
      )
      assert mean.shape == sample_shape + batch_shape + (
          duration,
          state_dim,
      )
  
      # Check that antithetic sampling works as expected.
      noise3 = torch.stack([noise, zero, -noise])
      sample3 = sequential_gaussian_filter_sample(
          init, trans, (3,) + sample_shape, noise3
      )
      expected = torch.stack([sample, mean, 2 * mean - sample])
      assert torch.allclose(sample3, expected)
  
imports: import math
  from collections import OrderedDict
  import pytest
  import torch
  from torch.distributions import constraints, transform_to
  from torch.nn.functional import pad
  import pyro.distributions
  from pyro.distributions.util import broadcast_shape
  from pyro.ops.gaussian import AffineNormal, Gaussian, gaussian_tensordot, matrix_and_gaussian_to_gaussian, matrix_and_mvn_to_gaussian, mvn_to_gaussian, sequential_gaussian_filter_sample, sequential_gaussian_tensordot
  from tests.common import assert_close
  from tests.ops.gaussian import assert_close_gaussian, random_gaussian, random_mvn
label_desc: Use image node_id 21 for calling a global function with example usage: test_sequential_gaussian_filter_sample_antithetic(sample_shape, batch_shape, state_dim, num_steps) without return types