-
Notifications
You must be signed in to change notification settings - Fork 0
/
record.py
29 lines (21 loc) · 798 Bytes
/
record.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# defines a record of information for graph construction
class Record:
def __init__(self, args, kwargs, outputs, op, name):
self.args = args
self.kwargs = kwargs
self.outputs = outputs
self.op = op
self.name = name
def __str__(self):
s = ""
s = s + "--- Record : " + self.name + " --- \n"
if (self.args is not None):
args_lst = list(self.args)
for arg in args_lst:
s = s + " Arg : " + str(arg) + "\n"
if (self.kwargs is not None):
for kw in self.kwargs.keys():
s = s + " KW : " + kw + str(self.kwargs[kw]) + "\n"
s = s + " Outputs : " + str(self.outputs) + "\n"
s = s + " Operation : " + str(self.op) + "\n"
return s