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

Method addTable

caffe2/python/docs/formatter.py:92–101  ·  view source on GitHub ↗
(self, table, noTitle=False)

Source from the content-addressed store, hash-verified

90 self.addRaw("\n\n```\n{text}```\n\n".format(text=text))
91
92 def addTable(self, table, noTitle=False):
93 self.addLinebreak()
94 assert(len(table) > 1)
95 if noTitle:
96 table.insert(0, [' ' for i in range(len(table[0]))])
97 self.addLine(' | '.join(table[0]))
98 self.addLine(' | '.join(['----' for i in range(len(table[0]))]))
99 for row in table[1:]:
100 self.addLine(' | '.join(row))
101 self.addLinebreak()
102
103 def addBreak(self):
104 self.addLine('\n---\n', True)

Callers

nothing calls this directly

Calls 5

addLinebreakMethod · 0.95
addLineMethod · 0.95
rangeFunction · 0.50
insertMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected