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

Class MetadataTuple

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

Source from the content-addressed store, hash-verified

37
38
39class MetadataTuple:
40 def __init__(self, dtype, shape):
41 self.dtype = dtype
42 self.shape = shape
43
44 def __iter__(self):
45 yield from [self.dtype, self.shape]
46
47 def __repr__(self):
48 return f"MetadataTuple({self.dtype}, {self.shape})"
49
50 def __str__(self):
51 ret = ""
52 meta_items = []
53 if self.dtype is not None:
54 meta_items.append(f"dtype={np.dtype(self.dtype).name}")
55 if self.shape is not None:
56 meta_items.append(f"shape={tuple(self.shape)}")
57 if meta_items:
58 ret += "[" + ", ".join(meta_items) + "]"
59 return ret
60
61 def __eq__(self, other):
62 return self.shape == other.shape and self.dtype == other.dtype
63
64
65@mod.export()

Callers 3

check_calibratorMethod · 0.90
addMethod · 0.85

Calls

no outgoing calls

Tested by 2

check_calibratorMethod · 0.72