Relax check on outputs (#15458)

Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/15458

many nets in the wild seem to have outputs that are never produced by the net.

Reviewed By: ZolotukhinM

Differential Revision: D13534185

fbshipit-source-id: 2b23b39c28404c53f68868f3bf6df53c5fea9eab
This commit is contained in:
Bram Wasti
2018-12-21 14:11:26 -08:00
committed by Facebook Github Bot
parent 6bf05bfde6
commit 235d47760b
2 changed files with 10 additions and 8 deletions

View File

@ -328,16 +328,15 @@ class TestTransformations(tu.TestCase):
atol=1e-04
)
def test_converterEnforceUnusedInputs(self):
def test_converterDontEnforceUnusedInputs(self):
net = core.Net("net")
net.Relu(["X"], ["Y"])
net.Proto().external_input.extend(["fake"])
# This should now work
transformer.AddNNPACK(net) # just testing the converter
def test_converterEnforceUnusedOutputs(self):
def test_converterDontEnforceUnusedOutputs(self):
net = core.Net("net")
net.Relu(["X"], ["Y"])
net.Proto().external_output.extend(["fake"])
with self.assertRaises(Exception):
transformer.AddNNPACK(net) # just testing the converter
transformer.AddNNPACK(net) # just testing the converter