code: def test_torch_serialize_attributes(local_params):
      with pyro.settings.context(module_local_params=local_params):
          module = PyroModule()
          module.x = PyroParam(
              torch.tensor(1.234), constraints.positive
          )
          module.y = nn.Parameter(torch.randn(3))
          assert isinstance(module.x, torch.Tensor)
  
          # Work around https://github.com/pytorch/pytorch/issues/27972
          with warnings.catch_warnings():
              warnings.filterwarnings("ignore", category=UserWarning)
              f = io.BytesIO()
              torch.save(module, f)
              pyro.clear_param_store()
              f.seek(0)
              actual = torch.load(f)
  
          assert_equal(actual.x, module.x)
          actual_names = {name for name, _ in actual.named_parameters()}
          expected_names = {
              name for name, _ in module.named_parameters()
          }
          assert actual_names == expected_names
  
imports: import io
  import warnings
  import pytest
  import torch
  from torch import nn
  from torch.distributions import constraints, transform_to
  import pyro
  import pyro.distributions
  from pyro import poutine
  from pyro.infer import SVI, Trace_ELBO
  from pyro.nn.module import PyroModule, PyroParam, PyroSample, clear, to_pyro_module_
  from pyro.optim import Adam
  from tests.common import assert_equal
label_desc: Use image node_id 17 for calling a global function with example usage: test_torch_serialize_attributes(local_params) without return types