Poutine.mask intended usage

Hi,

I’m a new user. Pyro seems like a very useful tool, but I’m having trouble handling missing data. I’ve want to use poutine.mask to ignore missing data as in done in the answer to this question: Modeling missingness indicators.

When I try doing this in the SVI tutorial, I get a type error, but my mask is definitely of type torch.uint8, not NoneType

ValueError: Expected mask to be a boolean but got <class ‘NoneType’>
Trace Shapes:
Param Sites:
Sample Sites:
latent_fairness dist |
value |

Here’s a colab link to the modified tutorial: Google Colab
Am I using poutine.mask correctly?

Thanks!

Hi, that error is caused by not passing the mask as a keyword argument to poutine.mask. If you use with poutine.mask(mask=mask) instead of with poutine.mask(mask) it should go away.

FYI @jrossen I opened a GitHub issue about this, I agree the error is confusing.

Thanks for the help! Sorry for the late reply, somehow missed the notification for this.