Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

[Retiarii] Use ValueChoice inline in a serializable instance #3382

Merged

Conversation

ultmaster
Copy link
Contributor

@ultmaster ultmaster commented Feb 15, 2021

Goal

self.conv = nn.Conv2d(3, 32, kernel_size=nn.ValueChoice([3, 5, 7]))

Work items

  • Serializer support
  • Graphgen support
  • Mutator support
  • Test

@ultmaster ultmaster marked this pull request as ready for review February 22, 2021 04:07
@QuanluZhang
Copy link
Contributor

@ultmaster looks great. please update doc accordingly

@J-shang J-shang mentioned this pull request Feb 24, 2021
94 tasks
@@ -152,6 +152,14 @@ def _dump(self) -> Any:
}
return ret

def get_nodes(self) -> List['Node']:
Copy link
Contributor

Choose a reason for hiding this comment

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

The return type is Iterable in this case.

@@ -237,6 +273,13 @@ def forward(self):
warnings.warn('You should not run forward of this module directly.')
return self.candidates[0]

def __translate__(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it proper to use __xxx__ for non-builtin method name? I'm not sure.

@ultmaster ultmaster merged commit aea82d7 into microsoft:master Feb 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants