MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / from_feed_dict

Method from_feed_dict

tools/Polygraphy/polygraphy/common/struct.py:80–94  ·  view source on GitHub ↗

Constructs a new TensorMetadata using information from the provided feed_dict. Args: feed_dict (OrderedDict[str, numpy.ndarray]): A mapping of input tensor names to corresponding input NumPy arrays. Returns: TensorMetadata

(feed_dict)

Source from the content-addressed store, hash-verified

78
79 @staticmethod
80 def from_feed_dict(feed_dict):
81 """
82 Constructs a new TensorMetadata using information from the provided feed_dict.
83
84 Args:
85 feed_dict (OrderedDict[str, numpy.ndarray]):
86 A mapping of input tensor names to corresponding input NumPy arrays.
87
88 Returns:
89 TensorMetadata
90 """
91 meta = TensorMetadata()
92 for name, arr in feed_dict.items():
93 meta.add(name, arr.dtype, arr.shape)
94 return meta
95
96 def add(self, name, dtype, shape, min_shape=None, max_shape=None):
97 """

Callers 2

fallback_inferenceMethod · 0.80
execute_runnerMethod · 0.80

Calls 3

addMethod · 0.95
TensorMetadataClass · 0.85
itemsMethod · 0.45

Tested by

no test coverage detected