MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / rename_op_output

Function rename_op_output

detectron2/export/shared.py:729–747  ·  view source on GitHub ↗

Rename the op_id-th operator in predict_net, change it's output_id-th input's name to the new_name. It also does automatic re-route and change external_output and if necessary. - It allows multiple consumers of its output. - This function modifies predict_net in-place, d

(predict_net: caffe2_pb2.NetDef, op_id: int, output_id: int, new_name: str)

Source from the content-addressed store, hash-verified

727
728
729def rename_op_output(predict_net: caffe2_pb2.NetDef, op_id: int, output_id: int, new_name: str):
730 """
731 Rename the op_id-th operator in predict_net, change it's output_id-th input's
732 name to the new_name. It also does automatic re-route and change
733 external_output and if necessary.
734 - It allows multiple consumers of its output.
735 - This function modifies predict_net in-place, doesn't need init_net.
736 """
737 assert isinstance(predict_net, caffe2_pb2.NetDef)
738
739 ssa, blob_versions = core.get_ssa(predict_net)
740
741 versioned_inputs, versioned_outputs = ssa[op_id]
742 old_name, version = versioned_outputs[output_id]
743
744 # update predict_net
745 _rename_versioned_blob_in_proto(
746 predict_net, old_name, new_name, version, ssa, {}, blob_versions
747 )
748
749
750def get_sub_graph_external_input_output(

Callers 3

fuse_alias_placeholderFunction · 0.85
rename_op_inputFunction · 0.85
remove_reshape_for_fcFunction · 0.85

Calls 1

Tested by

no test coverage detected