8af731463df46f6c73c933bdc45ed9a4ecd4e422,nni/retiarii/codegen/pytorch.py,,model_to_pytorch_script,#Any#,7
Before Change
def model_to_pytorch_script(model: Model) -> str:
graphs = [graph_to_pytorch_model(name, cell) for name, cell in model.graphs.items()]
return _PyTorchScriptTemplate.format("\n\n".join(graphs)).strip()
def _sorted_incoming_edges(node: Node) -> List[Edge]:
After Change
graphs.append(graph_code)
total_pkgs.update(import_pkgs)
// TODO: set correct PATH for the packages (after launch refactor)
pkgs_code = "\n".join(["import {}".format(pkg) for pkg in total_pkgs])
return _PyTorchScriptTemplate.format(pkgs_code, "\n\n".join(graphs)).strip()
def _convert_name(name: str) -> str:
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: microsoft/nni
Commit Name: 8af731463df46f6c73c933bdc45ed9a4ecd4e422
Time: 2020-11-17
Author: Quanlu.Zhang@microsoft.com
File Name: nni/retiarii/codegen/pytorch.py
Class Name:
Method Name: model_to_pytorch_script
Project Name: dmlc/gluon-cv
Commit Name: b7988369f77e12525604e2613b279c13f041f484
Time: 2019-12-04
Author: wuxun.zhang@intel.com
File Name: scripts/pose/simple_pose/validate.py
Class Name:
Method Name:
Project Name: ray-project/ray
Commit Name: 2cf4c7253ce1fd01975fcf970e52434e44f6d71f
Time: 2021-03-04
Author: ekhliang@gmail.com
File Name: python/ray/util/client/worker.py
Class Name: Worker
Method Name: get