internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: fail2ban/fail2ban

Issue:
wrong recursion check in some constellation within substituteRecursiveTags
Just to reminder for me...

Invalid recursion check in substituteRecursiveTags.

For example action `bsd-ipfw` produced ValueError('properties contain self referencing definitions and cannot be resolved...')

Almost fixed in 0.10 (building test cases)

chery-pick to 0.9 (master)



Discussion:

Resolving patch:
diff --git a/fail2ban/server/action.py b/fail2ban/server/action.py
--- a/fail2ban/server/action.py
+++ b/fail2ban/server/action.py
@@ -400,12 +400,16 @@ def substituteRecursiveTags(cls, tags):
 				value = str(tags[tag])
 				# search and replace all tags within value, that can be interpolated using other tags:
 				m = t.search(value)
-				done = []
+				done = {}
+				last_found = tag
 				#logSys.log(5, 'TAG: %s, value: %s' % (tag, value))
 				while m:
 					found_tag = m.group(1)
 					#logSys.log(5, 'found: %s' % found_tag)
-					if found_tag == tag or found_tag in done:
+					curdone = done.get(last_found)
+					if curdone is None:
+						done[last_found] = curdone = []
+					if found_tag == tag or found_tag in curdone:
 						# recursive definitions are bad
 						#logSys.log(5, 'recursion fail tag: %s value: %s' % (tag, value) )
 						return False
@@ -417,7 +421,8 @@ def substituteRecursiveTags(cls, tags):
 						continue
 					value = value.replace('<%s>' % found_tag , tags[found_tag])
 					#logSys.log(5, 'value now: %s' % value)
-					done.append(found_tag)
+					curdone.append(found_tag)
+					last_found = found_tag
 					m = t.search(value, m.start())
 				#logSys.log(5, 'TAG: %s, newvalue: %s' % (tag, value))
 				# was substituted?


Test patch:
diff --git a/fail2ban/tests/actiontestcase.py b/fail2ban/tests/actiontestcase.py
--- a/fail2ban/tests/actiontestcase.py
+++ b/fail2ban/tests/actiontestcase.py
@@ -29,6 +29,7 @@
 import tempfile
 
 from ..server.action import CommandAction, CallingMap
+from ..server.actions import OrderedDict
 
 from .utils import LogCaptureTestCase
 from .utils import pid_exists
@@ -58,6 +59,12 @@ def testSubstituteRecursiveTags(self):
 		# Unresolveable substition
 		self.assertFalse(CommandAction.substituteRecursiveTags({'A': 'to=<B> fromip=<IP>', 'C': '<B>', 'B': '<C>', 'D': ''}))
 		self.assertFalse(CommandAction.substituteRecursiveTags({'failregex': 'to=<honeypot> fromip=<IP>', 'sweet': '<honeypot>', 'honeypot': '<sweet>', 'ignoreregex': ''}))
+		# No-recursion, just multiple replacement of tag <T>, should be successful
+		if OrderedDict: # we need here an ordered, because the sequence of iteration is very important for this test
+			self.assertEqual(CommandAction.substituteRecursiveTags(
+				OrderedDict((('X', 'x=x<T>'), ('T', '1'), ('Z', '<X> <T> <Y>'), ('Y', 'y=y<T>')))
+				), {'X': 'x=x1', 'T': '1', 'Y': 'y=y1', 'Z': 'x=x1 1 y=y1'}
+			)
 		# missing tags are ok
 		self.assertEqual(CommandAction.substituteRecursiveTags({'A': '<C>'}), {'A': '<C>'})
 		self.assertEqual(CommandAction.substituteRecursiveTags({'A': '<C> <D> <X>','X':'fun'}), {'A': '<C> <D> fun', 'X':'fun'})
Repository: fail2ban/fail2ban

Issue:
Wrong install path `/usr/share/doc/` for some platform (install fails on Mac OS 10.11 "El Capitan")
Due to El Capitan's new "System Integrity Protection", there is no way to create the directory at /usr/share/doc/fail2ban, even as root:

> % sudo python setup.py install
> running install
> Checking .pth file support in /Library/Python/2.7/site-packages/
> ...
> running install_data
> creating /usr/share/doc/fail2ban
> error: could not create '/usr/share/doc/fail2ban': Operation not permitted

However, /usr/local is modifiable, so changing line 151 of setup.py from

> '/usr/share/doc/fail2ban'

to

> '/usr/local/doc/fail2ban'

allowed the installer to proceed.



Discussion:
Apple's info on SIP: https://developer.apple.com/library/prerelease/mac/documentation/Security/Conceptual/System_Integrity_Protection_Guide/Introduction/Introduction.html

@fail2ban/developers any idea to fix it (make it configurable)?

Should we just install under /usr/local/doc/fail2ban on osx, or not install those doc files at all there?


Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -19,9 +19,11 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
 __author__ = "Cyril Jaquier, Steven Hiscocks, Yaroslav Halchenko"
-__copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2008-2013 Fail2Ban Contributors"
+__copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2008-2016 Fail2Ban Contributors"
 __license__ = "GPL"
 
+import platform
+
 try:
 	import setuptools
 	from setuptools import setup
@@ -85,6 +87,18 @@
 	# realpath is used to possibly resolve /var/run -> /run symlink
 	data_files_extra += [(realpath('/var/run/fail2ban'), '')]
 
+# Installing documentation files only under Linux or other GNU/ systems
+# (e.g. GNU/kFreeBSD), since others might have protective mechanisms forbidding
+# installation there (see e.g. #1233)
+platform_system = platform.system().lower()
+doc_files = ['README.md', 'DEVELOP', 'FILTERS', 'doc/run-rootless.txt']
+if platform_system in ('solaris', 'sunos'):
+	doc_files.append('README.Solaris')
+if platform_system in ('linux', 'solaris', 'sunos') or platform_system.startswith('gnu'):
+	data_files_extra.append(
+		('/usr/share/doc/fail2ban', doc_files)
+	)
+
 # Get version number, avoiding importing fail2ban.
 # This is due to tests not functioning for python3 as 2to3 takes place later
 exec(open(join("fail2ban", "version.py")).read())
@@ -148,10 +162,6 @@
 		('/var/lib/fail2ban',
 			''
 		),
-		('/usr/share/doc/fail2ban',
-			['README.md', 'README.Solaris', 'DEVELOP', 'FILTERS',
-			 'doc/run-rootless.txt']
-		)
 	] + data_files_extra,
 	**setup_extra
 )


Test patch:
Repository: fail2ban/fail2ban

Issue:
badips.py should use https
Hi,

What about asking `badips.py` to use https ?

I think the following :
`_badips = "http://www.badips.com"`
Would just have to be changed to :
`_badips = "https://www.badips.com"`

Thank you 👍 

Ben


Discussion:

Resolving patch:
diff --git a/config/action.d/badips.py b/config/action.d/badips.py
--- a/config/action.d/badips.py
+++ b/config/action.d/badips.py
@@ -81,7 +81,7 @@ class BadIPsAction(ActionBase): # pragma: no cover - may be unavailable
 	"""
 
 	TIMEOUT = 10
-	_badips = "http://www.badips.com"
+	_badips = "https://www.badips.com"
 	def _Request(self, url, **argv):
 		return Request(url, headers={'User-Agent': self.agent}, **argv)
 


Test patch:
Repository: pyro-ppl/pyro

Issue:
pytorch broadcasting
in various places in the codebase we have tensor ops like `expand_as()`. given the extended broadcasting functionality in the latest version of pytorch, some of these may be unnecessary and/or clunky. more generally, we should investigate and deal with any pytorch warnings that popped once once we switched pytorch versions. for example: 

_UserWarning: other is not broadcastable to self, but they have the same number of elements.  Falling back to deprecated pointwise behavior._


Discussion:
@jpchen ; ) ?
some of these you dont want to remove, as broadcasting matches from the last index backwards and in lot of the cases, expand_as is doing the right thing. will need to check all of them. That warning actually looks like we need more, not less expands, since pt no longer does automatic pointwise operations. 
i can take a look at this next week

Resolving patch:
diff --git a/examples/categorical_bmm.py b/examples/categorical_bmm.py
--- a/examples/categorical_bmm.py
+++ b/examples/categorical_bmm.py
@@ -12,6 +12,7 @@
 from pyro.distributions import Bernoulli, Categorical
 from pyro.infer.kl_qp import KL_QP
 
+
 mnist = dset.MNIST(
     root='./data',
     train=True,
@@ -44,7 +45,7 @@ def local_model(i, datum):
     # do MLE for class means
     mu = pyro.param("mean_of_class_" + str(cll[0]), mean_param)
     mu_param = softmax(mu)
-    pyro.observe("obs_" + str(i), Bernoulli(mu_param), datum)
+    pyro.observe("obs_" + str(i), Bernoulli(mu_param), datum.view(1, -1))
     return cll
 
 


Test patch:
Repository: pyro-ppl/pyro

Issue:
Test batch_size parameter is correctly applied for all distributions
With #323, we are now supporting `batch_size` parameter for both the class and functional forms of both the distributions. Let us add a simple test to validate that this is working as expected. 


Discussion:

Resolving patch:
diff --git a/pyro/distributions/log_normal.py b/pyro/distributions/log_normal.py
--- a/pyro/distributions/log_normal.py
+++ b/pyro/distributions/log_normal.py
@@ -49,7 +49,7 @@ def sample(self):
         """
         Reparameterized log-normal sampler.
         """
-        eps = Variable(torch.randn(1).type_as(self.mu.data))
+        eps = Variable(torch.randn(self.mu.size()).type_as(self.mu.data))
         z = self.mu + self.sigma * eps
         return torch.exp(z)
 


Test patch:
diff --git a/tests/distributions/dist_fixture.py b/tests/distributions/dist_fixture.py
--- a/tests/distributions/dist_fixture.py
+++ b/tests/distributions/dist_fixture.py
@@ -39,7 +39,7 @@ def get_num_test_data(self):
         return len(self.test_data)
 
     def get_samples(self, num_samples, **dist_params):
-        return [self.pyro_dist(**dist_params).data.cpu().numpy() for _ in range(num_samples)]
+        return self.pyro_dist(batch_size=num_samples, **dist_params)
 
     def get_test_data(self, idx, wrap_tensor=True):
         if not wrap_tensor:
diff --git a/tests/distributions/test_distributions.py b/tests/distributions/test_distributions.py
--- a/tests/distributions/test_distributions.py
+++ b/tests/distributions/test_distributions.py
@@ -94,11 +94,11 @@ def test_mean_and_variance(dist):
     num_samples = dist.get_num_samples(SINGLE_TEST_DATUM_IDX)
     dist_params = dist.get_dist_params(SINGLE_TEST_DATUM_IDX)
     torch_samples = dist.get_samples(num_samples, **dist_params)
-    sample_mean = np.mean(torch_samples, 0)
-    sample_var = np.var(torch_samples, 0)
+    sample_mean = torch_samples.float().mean(0)
+    sample_var = torch_samples.float().var(0)
     try:
-        analytic_mean = unwrap_variable(dist.pyro_dist.analytic_mean(**dist_params))
-        analytic_var = unwrap_variable(dist.pyro_dist.analytic_var(**dist_params))
+        analytic_mean = dist.pyro_dist.analytic_mean(**dist_params)
+        analytic_var = dist.pyro_dist.analytic_var(**dist_params)
         assert_equal(sample_mean, analytic_mean, prec=dist.prec)
         assert_equal(sample_var, analytic_var, prec=dist.prec)
     except (NotImplementedError, ValueError):
Repository: pyro-ppl/pyro

Issue:
TransformedDistribution's event_shape forwards to incorrect base distribution's method
Probably a typo:

https://github.com/uber/pyro/blob/51a2ccfe9445c7072c3150c4abe1ab1d2ac17246/pyro/distributions/transformed_distribution.py#L62


Discussion:
Could you be more specific? It may be weird that `.batch_shape()` is a method, but that is indeed our current behavior.
Oh sorry, Now I see that `.event_shape()` returns `...batch_shape(...)`. Thanks!

Resolving patch:
diff --git a/pyro/distributions/transformed_distribution.py b/pyro/distributions/transformed_distribution.py
--- a/pyro/distributions/transformed_distribution.py
+++ b/pyro/distributions/transformed_distribution.py
@@ -59,7 +59,7 @@ def event_shape(self, *args, **kwargs):
         """
         Ref: :py:meth:`pyro.distributions.distribution.Distribution.event_shape`
         """
-        return self.base_dist.batch_shape(*args, **kwargs)
+        return self.base_dist.event_shape(*args, **kwargs)
 
     def log_pdf(self, y, *args, **kwargs):
         """


Test patch:
diff --git a/tests/distributions/test_transformed_distribution.py b/tests/distributions/test_transformed_distribution.py
--- a/tests/distributions/test_transformed_distribution.py
+++ b/tests/distributions/test_transformed_distribution.py
@@ -63,9 +63,18 @@ def lognormal():
     return Fixture(pyro_dist=(dist.lognormal, LogNormal),
                    scipy_dist=sp.lognorm,
                    examples=[
-                       {'mu': [1.4], 'sigma': [0.4], 'test_data': [5.5]},
+                       {'mu': [1.4], 'sigma': [0.4],
+                        'test_data': [5.5]},
+                       {'mu': [1.4], 'sigma': [0.4],
+                        'test_data': [[5.5]]},
+                       {'mu': [[1.4, 0.4, 0.4], [1.4, 0.4, 0.6]],
+                        'sigma': [[2.6, 0.5, 0.5], [2.6, 0.5, 0.5]],
+                        'test_data': [[5.5, 6.4, 6.4], [5.5, 6.4, 6.4]]},
+                       {'mu': [[1.4], [0.4]], 'sigma': [[2.6], [0.5]],
+                        'test_data': [[5.5], [6.4]]}
                    ],
-                   scipy_arg_fn=lambda mu, sigma: ((np.array(sigma),), {"scale": np.exp(np.array(mu))}))
+                   scipy_arg_fn=lambda mu, sigma: ((np.array(sigma),),
+                                                   {"scale": np.exp(np.array(mu))}))
 
 
 def unwrap_variable(x):
@@ -108,3 +117,12 @@ def test_log_pdf_on_transformed_distribution(lognormal):
         sigma_lognorm.data.cpu().numpy(),
         scale=np.exp(mu_lognorm.data.cpu().numpy()))[0]
     assert_equal(log_px_torch, log_px_np, prec=1e-4)
+
+
+def test_shape(lognormal):
+    for idx in range(len(lognormal.test_data)):
+        dist_params = lognormal.get_dist_params(idx)
+        mu_lognorm = dist_params['mu']
+        sigma_lognorm = dist_params['sigma']
+        d = get_transformed_dist(dist.normal, sigma_lognorm, mu_lognorm)
+        assert_equal(d.sample(**dist_params).size(), d.shape(**dist_params))
Repository: pyro-ppl/pyro

Issue:
Deprecate dependency on scipy for pyro-ppl package
Once distributions are migrated upstream and we do not have a core dependency on scipy, we should remove this from our requirements in `setup.py` (add it to test dependencies), so that users do not need to install a separate 16MB file when they do a pip install of `pyro-ppl`.


Discussion:
is this true of numpy as well? (well aside from examples)
> is this true of numpy as well? (well aside from examples)

I think we use numpy at a few other places, but `numpy` package is really small, a few hundred kbs. It's scipy that we should definitely eliminate once PyTorch distributions library can do the heavy lifting.

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -37,7 +37,6 @@
     author_email='pyro@uber.com',
     install_requires=[
         'numpy>=1.7',
-        'scipy>=0.19.0',
         'cloudpickle>=0.3.1',
         'graphviz>=0.8',
         'networkx>=2.0.0',
@@ -56,6 +55,7 @@
             'pytest',
             'pytest-cov',
             'nbval',
+            'scipy>=0.19.0',
             # examples/tutorials
             'matplotlib',
             'visdom',


Test patch:
Repository: pyro-ppl/pyro

Issue:
DMM Example  Model and guide dims disagree when IAF is applied
When the number of IAF is non zero, the latent dimension changes to the same value as the batch size.


Discussion:
what version of pyro? what version of pytorch?
dev branch pyro (as of 16 hours ago), master pytorch
I tried fixing this, and I think we will need @fritzo's changes from https://github.com/pytorch/pytorch/pull/4937 to make it work. 

Resolving patch:
diff --git a/pyro/distributions/transformed_distribution.py b/pyro/distributions/transformed_distribution.py
--- a/pyro/distributions/transformed_distribution.py
+++ b/pyro/distributions/transformed_distribution.py
@@ -55,7 +55,10 @@ def sample(self, *args, **kwargs):
             next_input = y
         return next_input
 
-    def batch_shape(self, x=None, *args, **kwargs):
+    def shape(self, *args, **kwargs):
+        return self.base_dist.shape(*args, **kwargs)
+
+    def batch_shape(self, *args, **kwargs):
         return self.base_dist.batch_shape(*args, **kwargs)
 
     def event_shape(self, *args, **kwargs):
@@ -242,4 +245,4 @@ def batch_log_det_jacobian(self, y, *args, **kwargs):
         log_sigma = torch.log(sigma)
         if 'log_pdf_mask' in kwargs:
             log_sigma = log_sigma * kwargs['log_pdf_mask']
-        return log_sigma.sum(-1)
+        return log_sigma


Test patch:
diff --git a/tests/test_examples.py b/tests/test_examples.py
--- a/tests/test_examples.py
+++ b/tests/test_examples.py
@@ -30,10 +30,14 @@ def discover_examples():
                 # Either this is not a main file, or we don't know how to run it cheaply.
                 continue
             example = os.path.relpath(path, EXAMPLES_DIR)
+            # TODO: May be worth whitelisting the set of arguments to test
+            # for each example.
             CPU_EXAMPLES.append((example, args))
             for flag in ['--enum-discrete', '--aux-loss']:
                 if flag in text:
                     CPU_EXAMPLES.append((example, args + [flag]))
+            if '--num-iafs' in text:
+                CPU_EXAMPLES.append((example, args + ['--num-iafs=1']))
             if '--cuda' in text:
                 CUDA_EXAMPLES.append((example, args + ['--cuda']))
     CPU_EXAMPLES.sort()
Repository: pyro-ppl/pyro

Issue:
pyro.poutine module is absent from sphinx docs
For example, there is no documentation for `pyro.poutine.block()`


Discussion:

Resolving patch:
diff --git a/pyro/poutine/__init__.py b/pyro/poutine/__init__.py
--- a/pyro/poutine/__init__.py
+++ b/pyro/poutine/__init__.py
@@ -48,7 +48,7 @@ def replay(fn=None, trace=None, sites=None):
     :param fn: a stochastic function (callable containing pyro primitive calls)
     :param trace: a Trace data structure to replay against
     :param sites: list or dict of names of sample sites in fn to replay against,
-    defaulting to all sites
+        defaulting to all sites
     :returns: stochastic function wrapped in a ReplayHandler
     :rtype: pyro.poutine.ReplayHandler
 
@@ -99,8 +99,8 @@ def block(fn=None, hide=None, expose=None, hide_types=None, expose_types=None):
 def escape(fn=None, escape_fn=None):
     """
     :param fn: a stochastic function (callable containing pyro primitive calls)
-    :param escape_fn: function that takes a partial trace and a site
-    and returns a boolean value to decide whether to exit at that site
+    :param escape_fn: function that takes a partial trace and a site,
+        and returns a boolean value to decide whether to exit at that site
     :returns: stochastic function wrapped in EscapeHandler
 
     Alias for EscapeHandler constructor.
@@ -220,10 +220,10 @@ def queue(fn=None, queue=None, max_tries=None,
     :param fn: a stochastic function (callable containing pyro primitive calls)
     :param queue: a queue data structure like multiprocessing.Queue to hold partial traces
     :param max_tries: maximum number of attempts to compute a single complete trace
-    :param extend_fn: function (possibly stochastic) that takes a partial trace and a site
-    and returns a list of extended traces
-    :param escape_fn: function (possibly stochastic) that takes a partial trace and a site
-    and returns a boolean value to decide whether to exit
+    :param extend_fn: function (possibly stochastic) that takes a partial trace and a site,
+        and returns a list of extended traces
+    :param escape_fn: function (possibly stochastic) that takes a partial trace and a site,
+        and returns a boolean value to decide whether to exit
     :param num_samples: optional number of extended traces for extend_fn to return
     :returns: stochastic function wrapped in poutine logic
 


Test patch:
Repository: pyro-ppl/pyro

Issue:
Possible bug in docs
Should these two `iarange` have different names?

https://github.com/uber/pyro/blob/05e83add8a12b6ebc4bd4ef5846ffd6eb1a326d8/pyro/primitives.py#L230-L231


Discussion:
indeed thanks!

Resolving patch:
diff --git a/pyro/primitives.py b/pyro/primitives.py
--- a/pyro/primitives.py
+++ b/pyro/primitives.py
@@ -228,7 +228,7 @@ class iarange(object):
 
         # This reuses two different independence contexts.
         >>> x_axis = iarange('outer', 320, dim=-1)
-        >>> y_axis = iarange('outer', 200, dim=-2)
+        >>> y_axis = iarange('inner', 200, dim=-2)
         >>> with x_axis:
                 x_noise = sample("x_noise", Normal(loc, scale).expand_by([320]))
         >>> with y_axis:


Test patch:
Repository: pyro-ppl/pyro

Issue:
Update paramstore documentation
Params are not properly reused from the paramstore via `.load()` since the default flag `update_module_params` is false (iirc this is because of `random_module`).  the interface/defaults should be revisited and at the very least, documentation updated.

[source](https://forum.pyro.ai/t/pyro-get-param-store-load-documentation/299)


Discussion:

Resolving patch:
diff --git a/pyro/params/param_store.py b/pyro/params/param_store.py
--- a/pyro/params/param_store.py
+++ b/pyro/params/param_store.py
@@ -174,6 +174,14 @@ def load(self, filename):
         """
         Loads parameters from disk
 
+        .. note::
+
+           If using :meth:`pyro.module` on parameters loaded from
+           disk, be sure to set the ``update_module_params`` flag::
+
+               pyro.get_param_store().load('saved_params.save')
+               pyro.module('module', nn, update_module_params=True)
+
         :param filename: file name to load from
         :type name: str
         """


Test patch:
Repository: pyro-ppl/pyro

Issue:
lr scheduler not optimizing params
`svi.step()` is not updating parameters with each optimizer.  see #1241


Discussion:
It would also help to have a more fleshed-out `Example:` section in the docstring and a more end-to-end test. While looking at the PR I had trouble determining how the `LRScheduler`s were intended to be used.
ahh the pytorch scheduler only updates the scheduler and does not take an optimization step. this was my mistake - i had assumed pytorch was documented correctly and only tested the hyperparam updates not the optimization. sorry for the inconvenience.

Resolving patch:
diff --git a/pyro/optim/lr_scheduler.py b/pyro/optim/lr_scheduler.py
--- a/pyro/optim/lr_scheduler.py
+++ b/pyro/optim/lr_scheduler.py
@@ -16,6 +16,8 @@ class PyroLRScheduler(PyroOptim):
 
         optimizer = torch.optim.SGD
         pyro_scheduler = pyro.optim.ExponentialLR({'optimizer': optimizer, 'optim_args': {'lr': 0.01}, 'gamma': 0.1})
+        svi = SVI(model, guide, pyro_scheduler, loss=TraceGraph_ELBO())
+        svi.step()
     """
     def __init__(self, scheduler_constructor, optim_args):
         # pytorch scheduler
diff --git a/pyro/optim/optim.py b/pyro/optim/optim.py
--- a/pyro/optim/optim.py
+++ b/pyro/optim/optim.py
@@ -57,6 +57,12 @@ def __call__(self, params,  *args, **kwargs):
             # actually perform the step for the optim object
             self.optim_objs[p].step(*args, **kwargs)
 
+            # if optim object was a scheduler, perform an actual optim step
+            if isinstance(self.optim_objs[p], torch.optim.lr_scheduler._LRScheduler):
+                optim_kwargs = kwargs.copy()
+                optim_kwargs.pop('epoch', None)
+                self.optim_objs[p].optimizer.step(*args, **optim_kwargs)
+
     def get_state(self):
         """
         Get state associated with all the optimizers in the form of a dictionary with


Test patch:
diff --git a/tests/optim/test_optim.py b/tests/optim/test_optim.py
--- a/tests/optim/test_optim.py
+++ b/tests/optim/test_optim.py
@@ -108,6 +108,8 @@ def guide():
             opt = scheduler.optim_objs[scale].optimizer
             assert opt.state_dict()['param_groups'][0]['lr'] == 0.02
             assert opt.state_dict()['param_groups'][0]['initial_lr'] == 0.01
+            assert abs(pyro.param('loc').item()) > 1e-5
+            assert abs(pyro.param('scale').item()) - 0.5 > 1e-5
 
 
 @pytest.mark.parametrize('factory', [optim.Adam, optim.ClippedAdam, optim.RMSprop, optim.SGD])