[nomni] fix outputs check to replaceSubgraph (#38005)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/38005
D21445887 runs into a dbgo build crash on this stack P130135519
It is because the assertion sg_inputs_copy.size() == 0 is too restrictive.
nn::getOutputs(sg) returns "output" nodes which can include any inputs
that have additional consumers that are not in the subgraph itself.
To fix, proposing to remove inputs from the output check.
Test Plan:
Run tests
Sanity canaries:
https://our.intern.facebook.com/intern/ads/canary/426498931666198610/
https://our.intern.facebook.com/intern/ads/canary/426498935267166205/
Reviewed By: bwasti
Differential Revision: D21445881
fbshipit-source-id: 419a4b1a230f0370619cea574403bfa114e56a7c