code: def test_plate_subsample_primitive_ok(subsample_size, num_samples):
      @infer.config_enumerate(num_samples=num_samples, tmc="full")
      def model():
          with pyro.plate(
              "plate", 10, subsample_size=subsample_size, dim=None
          ):
              p0 = torch.tensor(0.0)
              p0 = pyro.subsample(p0, event_dim=0)
              assert p0.shape == ()
              p = 0.5 * torch.ones(10)
              p = pyro.subsample(p, event_dim=0)
              assert len(p) == (
                  subsample_size if subsample_size else 10
              )
              pyro.sample("x", dist.Bernoulli(p))
  
      assert_ok(model, max_plate_nesting=1)
  
file_path: pyro/tests/contrib/funsor/test_valid_models_plate.py
imports: import logging
  import pytest
  import torch
  from pyro.ops.indexing import Vindex
  from tests.common import xfail_param
label_desc: Use image node_id 6 for calling a global function with example usage: test_plate_subsample_primitive_ok(subsample_size, num_samples) without return types