Extract net and blobs assignment to separate functions

Summary:
Use AddNet and AddBlobs to add net and blobs to meta_net_def.
This a codemod and does not change the functionality.
It is for preparation of the protobuf change.
Depends on: D4770648

Reviewed By: salexspb

Differential Revision: D4771110

fbshipit-source-id: 00cecb2105f2c332bd50c3c51b9a10e1004fa90f
This commit is contained in:
Fei Sun 2017-03-24 13:05:38 -07:00 committed by Facebook Github Bot
parent e591ddb70b
commit 29c1102806

View File

@ -206,5 +206,13 @@ def debug(f):
return wrapper
def AddBlobs(meta_net_def, blob_name, blob_def):
meta_net_def.blobs[blob_name] = blob_def
def AddPlan(meta_net_def, plan_name, plan_def):
meta_net_def.plans[plan_name] = str(plan_def)
def AddNet(meta_net_def, net_name, net_def):
meta_net_def.nets[net_name] = net_def