caffe2 - Util to cleanup external inputs and outputs from a NetDef (#18194)
authorDuc Ngo <duc@fb.com>
Fri, 22 Mar 2019 18:14:40 +0000 (11:14 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 22 Mar 2019 18:23:03 +0000 (11:23 -0700)
commit172ec4ace520a72729191b95b9f21c651aa5e245
tree33c294862de560a1b7c0b6505e227f49595dd39a
parent7397eb7e8edb0bb1f3d467acaa5f1c5648d50901
caffe2 - Util to cleanup external inputs and outputs from a NetDef (#18194)

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

Add a util method to cleanup external inputs and outputs from a NetDef

The following conditions will be met after the modification
- No duplicate external inputs
- No duplicate external outputs
- Going through list of ops in order, all op inputs must be outputs
from other ops, or registered as external inputs.
- All external outputs must be outputs of some operators.

Reviewed By: ZolotukhinM

Differential Revision: D14528589

fbshipit-source-id: c8d82fda1946aa3696abcbec869a4a8bb22f09b6
caffe2/utils/proto_utils.cc
caffe2/utils/proto_utils.h
caffe2/utils/proto_utils_test.cc