Skip to content

Conversation

fritzo
Copy link
Member

@fritzo fritzo commented Jan 19, 2024

This fixes two errors I was seeing on Python 3.8.11 and Python 3.11.4:

1. A mypy error

    @functools.wraps(fn)
    def _fn(
        *args: _P.args,
        name: Optional[str] = None,
        infer: Optional[InferDict] = None,
        obs: Optional[_T] = None,
        **kwargs: _P.kwargs,
    ) -> Optional[_T]:
        is_observed = obs is not None

        if not am_i_wrapped():
            return fn(*args, **kwargs)
        else:
>           msg = Message[_P, _T](
                type=type,
                name=name,
                fn=fn,
                is_observed=is_observed,
                args=args,
                kwargs=kwargs,
                value=obs,
                scale=1.0,
                mask=None,
                cond_indep_stack=(),
                done=False,
                stop=False,
                continuation=None,
                infer=infer if infer is not None else {},
            )
E           TypeError: '_TypedDictMeta' object is not subscriptable

../../pyro-ppl/pyro/pyro/poutine/runtime.py:354: TypeError

2. A ruff line too long error

ruff check .
pyro/poutine/indep_messenger.py:29:121: E501 Line too long (129 > 120 characters)

@fritzo fritzo merged commit 1a11185 into dev Jan 21, 2024
@ordabayevy ordabayevy deleted the fix-message-subscript branch February 10, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants