MCPcopy Create free account
hub / github.com/pytorch/pytorch / _direct_initialize_inputs

Method _direct_initialize_inputs

caffe2/python/onnx/backend.py:634–642  ·  view source on GitHub ↗
(cls, inputs, initialized, ws, device_option)

Source from the content-addressed store, hash-verified

632
633 @classmethod
634 def _direct_initialize_inputs(cls, inputs, initialized, ws, device_option):
635 for value_info in inputs:
636 if value_info.name in initialized:
637 continue
638 shape = list(d.dim_value for d in value_info.type.tensor_type.shape.dim)
639 ws.FeedBlob(
640 value_info.name,
641 np.ones(shape, dtype=onnx.mapping.TENSOR_TYPE_TO_NP_TYPE[value_info.type.tensor_type.elem_type]),
642 device_option)
643
644 @staticmethod
645 def optimize_onnx(input, init=False, predict=False):

Callers 1

prepareMethod · 0.80

Calls 2

listFunction · 0.85
onesMethod · 0.45

Tested by

no test coverage detected