Skip to content

Conversation

@driazati
Copy link
Contributor

@driazati driazati commented May 29, 2019

A bunch of modules were missing entries for __constants__ which was making their __repr__s not work. Others had __constants__ that were not necessary since it was provided by some parent class instead.

Fixes #20978

Differential Revision: D15539518

@pytorchbot pytorchbot added oncall: jit Add this issue/PR to JIT oncall triage queue module: nn Related to torch.nn labels May 29, 2019
@driazati driazati requested review from eellison and suo May 29, 2019 18:14
Copy link
Contributor

@eellison eellison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good if tests pass



class _InstanceNorm(_BatchNorm):
__constants__ = ['running_mean', 'running_var', 'weight', 'bias',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why were these all removed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They're on the parent class


@weak_module
class _ConvTransposeMixin(object):
__constants__ = ['stride', 'padding', 'kernel_size', 'dim_size',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same ?

@facebook-github-bot
Copy link
Contributor

@driazati merged this pull request in 736bf7b.

@facebook-github-bot facebook-github-bot deleted the driazati/cons branch July 13, 2020 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Merged module: nn Related to torch.nn oncall: jit Add this issue/PR to JIT oncall triage queue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot print LayerNorm in ScriptModule

6 participants