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

TF NAS fix #2781

Merged
merged 1 commit into from
Aug 12, 2020
Merged

TF NAS fix #2781

merged 1 commit into from
Aug 12, 2020

Conversation

liuzhe-lz
Copy link
Contributor

No description provided.

@scarlett2018 scarlett2018 mentioned this pull request Aug 12, 2020
66 tasks
def build(self, input_shape):
self._check_built()
for op in self.choices:
op.build(input_shape)
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the meaning of op.build?

Copy link
Contributor Author

@liuzhe-lz liuzhe-lz Aug 12, 2020

Choose a reason for hiding this comment

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

TF layers do not require input shape to __init__, so they create weights when build is called.
Normally this happens implicitly during first forward pass. We trigger it manually because only one candidate layer is connected at first forward so other candidate layers cannot inference their input shape automatically.

Copy link
Contributor

Choose a reason for hiding this comment

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

got it, thanks.

@ultmaster ultmaster merged commit e7fccfb into microsoft:master Aug 12, 2020
LovPe pushed a commit to LovPe/nni that referenced this pull request Aug 17, 2020
@liuzhe-lz liuzhe-lz deleted the tf-nas-fix branch September 17, 2020 23:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants