When I ran the tests I get the following error , what could be the reason ?
[gw2] [ 67%] PASSED tests/infer/test_valid_models.py::test_iplate_iplate_swap_ok[TraceEnum_ELBO-full-0]
tests/infer/test_valid_models.py::test_iplate_iplate_swap_ok[TraceEnum_ELBO-full-inf]
[gw7] [ 67%] FAILED tests/infer/test_jit.py::test_masked_fill
======================================================================== FAILURES ========================================================================
____________________________________________________________________ test_masked_fill ____________________________________________________________________
[gw7] darwin – Python 3.6.3 /Users/hrishikesh/anaconda3/envs/pyro_env/bin/python
def test_masked_fill():
def f(y, mask):
return y.clone().masked_fill_(mask, 0.)
x = torch.tensor([-float('inf'), -1., 0., 1., float('inf')])
y = x / x.unsqueeze(-1)
mask = ~(y == y)
jit_f = torch.jit.trace(f, (y, mask))
tests/infer/test_jit.py:137:
…/…/…/anaconda3/envs/pyro_env/lib/python3.6/site-packages/torch/jit/init.py:604: in trace
_check_trace([example_inputs], func, executor_options, module, check_tolerance)
…/…/…/anaconda3/envs/pyro_env/lib/python3.6/site-packages/torch/autograd/grad_mode.py:43: in decorate_no_grad
return func(*args, **kwargs)
…/…/…/anaconda3/envs/pyro_env/lib/python3.6/site-packages/torch/jit/init.py:505: in _check_trace
traced_outs = run_mod_and_filter_tensor_outputs(module, inputs, ‘trace’)
mod = f()
inputs = (tensor([[nan, 0., -0., -0., nan],
[inf, 1., -0., -1., -inf],
[-inf, -inf, nan, inf, inf],
[… [0, 0, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 0, 0],
[1, 0, 0, 0, 1]], dtype=torch.uint8))
running_what = ‘trace’
def run_mod_and_filter_tensor_outputs(mod, inputs, running_what):
try:
outs = wrap_retval(mod(*_clone_inputs(inputs)))
outs = [out for out in outs if isinstance(out, torch.Tensor)]
return outs
except Exception as e:
raise TracingCheckError(*graph_diagnostic_info(),
extra_msg='Encountered an exception while running the ' + running_what +
' with test inputs.\nException:\n' + indent(str(e)))
E torch.jit.TracingCheckError: Tracing failed sanity checks!
E Encountered an exception while running the trace with test inputs.
E Exception:
E
E Schema not found for node. File a bug report.
E Node: %4 : Dynamic = aten::masked_fill(%2, %mask, %3)
E
E Input types:Dynamic, Byte(*, ), float
E candidates were:
E graph(%y : Double(, )
E %mask : Byte(, *)) {
E %2 : Dynamic = aten::clone(%y)
E %3 : float = prim::Constantvalue=0
E %4 : Dynamic = aten::masked_fill(%2, %mask, %3)
E return (%4);
E }
E
E :
E /Users/hrishikesh/Hrishikesh/Projects/pyro/tests/infer/test_jit.py(132): f
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/torch/jit/init.py(597): trace
E /Users/hrishikesh/Hrishikesh/Projects/pyro/tests/infer/test_jit.py(137): test_masked_fill
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/python.py(196): pytest_pyfunc_call
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/callers.py(187): _multicall
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(61):
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(67): _hookexec
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/hooks.py(284): call
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/python.py(1431): runtest
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/runner.py(111): pytest_runtest_call
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/callers.py(187): _multicall
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(61):
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(67): _hookexec
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/hooks.py(284): call
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/runner.py(183):
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/runner.py(201): init
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/runner.py(185): call_runtest_hook
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/runner.py(161): call_and_report
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/runner.py(81): runtestprotocol
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/runner.py(66): pytest_runtest_protocol
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/callers.py(187): _multicall
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(61):
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(67): _hookexec
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/hooks.py(284): call
E (83): run_one_test
E (66): pytest_runtestloop
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/callers.py(187): _multicall
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(61):
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(67): _hookexec
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/hooks.py(284): call
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/main.py(215): _main
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/main.py(178): wrap_session
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/_pytest/main.py(208): pytest_cmdline_main
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/callers.py(187): _multicall
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(61):
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/manager.py(67): _hookexec
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/pluggy/hooks.py(284): call
E (270):
E (1): do_exec
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/execnet/gateway_base.py(1072): executetask
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/execnet/gateway_base.py(213): run
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/execnet/gateway_base.py(277): _perform_spawn
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/execnet/gateway_base.py(259): integrate_as_primary_thread
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/execnet/gateway_base.py(1047): serve
E /Users/hrishikesh/anaconda3/envs/pyro_env/lib/python3.6/site-packages/execnet/gateway_base.py(1534): serve
E (8):
E (1):
…/…/…/anaconda3/envs/pyro_env/lib/python3.6/site-packages/torch/jit/init.py:474: TracingCheckError