pyro icon indicating copy to clipboard operation
pyro copied to clipboard

[WIP] Type hints for NN and param store

Open kamathhrishi opened this issue 3 years ago • 6 comments

This PR continues the effort of adding type hints to the codebase as described in issue #2550. This PR will add type hints to NN and param module. Additionally, it will cover the utils script and some parts of Optim that weren't completed in the previous PR.

kamathhrishi avatar Jun 08 '21 17:06 kamathhrishi

@fritzo What exactly are the datatypes parameters? in https://github.com/pyro-ppl/pyro/blob/005032f10099188fea86f63b6baa46a27867983f/pyro/params/param_store.py#L185

kamathhrishi avatar Jun 11 '21 06:06 kamathhrishi

@kamathhrishi I believe the types are

def replace_param(self, param_name: str, new_param: torch.Tensor, old_param: torch.Tensor):

fritzo avatar Jun 11 '21 19:06 fritzo

Hi @kamathhrishi no rush, just FYI we switched from travis-ci to github actions so you'll need to merge the dev branch into this for ci to pass.

fritzo avatar Jun 15 '21 04:06 fritzo

Hi @kamathhrishi no rush, just FYI we switched from travis-ci to github actions so you'll need to merge the dev branch into this for ci to pass.

Thanks for letting me know. Not sure why Github doesn't notify here when my fork is lagging behind. Also I haven't formatted my code yet so it will continue to fail.

kamathhrishi avatar Jun 15 '21 09:06 kamathhrishi

@kamathhrishi is this ready for review? No rush, just don't want you blocked - if so, can you run make lint locally and fix the linter errors?

eb8680 avatar Aug 03 '21 14:08 eb8680

@eb8680 I will come back to this in September. Till then I will close it.

kamathhrishi avatar Aug 06 '21 08:08 kamathhrishi