From 3399edd18709e0c7c32dc6e4dbbecce4194fe0d3 Mon Sep 17 00:00:00 2001 From: Dilara Gokay Date: Thu, 5 May 2022 21:26:06 +0200 Subject: [PATCH 1/3] Update inspect.py --- pyro/infer/inspect.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyro/infer/inspect.py b/pyro/infer/inspect.py index dffb6fd6fd..e7eaa07b5f 100644 --- a/pyro/infer/inspect.py +++ b/pyro/infer/inspect.py @@ -549,6 +549,7 @@ def render_model( :returns: A model graph. :rtype: graphviz.Digraph """ + assert model_args is None or isinstance(model_args, tuple), "model_args must be None or tuple" relations = get_model_relations(model, model_args, model_kwargs) graph_spec = generate_graph_specification(relations, render_params=render_params) graph = render_graph(graph_spec, render_distributions=render_distributions) From 558563c7e1fd6ab0046e400577f1f6c84e556399 Mon Sep 17 00:00:00 2001 From: Dilara Gokay Date: Thu, 5 May 2022 21:51:08 +0200 Subject: [PATCH 2/3] Update inspect.py --- pyro/infer/inspect.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyro/infer/inspect.py b/pyro/infer/inspect.py index e7eaa07b5f..ad49b443bc 100644 --- a/pyro/infer/inspect.py +++ b/pyro/infer/inspect.py @@ -549,7 +549,9 @@ def render_model( :returns: A model graph. :rtype: graphviz.Digraph """ - assert model_args is None or isinstance(model_args, tuple), "model_args must be None or tuple" + assert model_args is None or isinstance( + model_args, tuple + ), "model_args must be None or tuple" relations = get_model_relations(model, model_args, model_kwargs) graph_spec = generate_graph_specification(relations, render_params=render_params) graph = render_graph(graph_spec, render_distributions=render_distributions) From 17d24882ec4934035285062bc1f02856cd9446a1 Mon Sep 17 00:00:00 2001 From: Dilara Gokay Date: Thu, 5 May 2022 21:58:37 +0200 Subject: [PATCH 3/3] Update inspect.py --- pyro/infer/inspect.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyro/infer/inspect.py b/pyro/infer/inspect.py index ad49b443bc..9bb5ca2520 100644 --- a/pyro/infer/inspect.py +++ b/pyro/infer/inspect.py @@ -552,6 +552,9 @@ def render_model( assert model_args is None or isinstance( model_args, tuple ), "model_args must be None or tuple" + assert model_kwargs is None or isinstance( + model_kwargs, dict + ), "model_kwargs must be None or dict" relations = get_model_relations(model, model_args, model_kwargs) graph_spec = generate_graph_specification(relations, render_params=render_params) graph = render_graph(graph_spec, render_distributions=render_distributions)