MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / __init__

Method __init__

scripts/gdb/pretty_printers.py:23–30  ·  view source on GitHub ↗
(self, val)

Source from the content-addressed store, hash-verified

21
22class SmallVectorPrinter:
23 def __init__(self, val):
24 t = val.type.template_argument(0)
25 self.begin = val["m_begin_ptr"].cast(t.pointer())
26 self.end = val["m_end_ptr"].cast(t.pointer())
27 self.size = self.end - self.begin
28 self.capacity = val["m_capacity_ptr"].cast(t.pointer()) - val[
29 "m_begin_ptr"
30 ].cast(t.pointer())
31
32 def to_string(self):
33 return "SmallVector of Size {}".format(self.size)

Callers

nothing calls this directly

Calls 1

castMethod · 0.45

Tested by

no test coverage detected