File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ class Tensor(db.Model):
117
117
118
118
class Buffer (db .Model ):
119
119
__table__ = buffers
120
-
120
+ device = relationship ( "Device" )
121
121
122
122
class InputTensor (db .Model ):
123
123
__table__ = input_tensors
@@ -139,6 +139,7 @@ class Operation(db.Model):
139
139
inputs = db .relationship ("InputTensor" , lazy = "joined" )
140
140
outputs = db .relationship ("OutputTensor" , lazy = "joined" )
141
141
stack_trace = db .relationship ("StackTrace" )
142
+ buffers = db .relationship ("Buffer" )
142
143
143
144
144
145
class OperationArgument (db .Model ):
Original file line number Diff line number Diff line change @@ -81,7 +81,6 @@ class Meta:
81
81
max_size_per_bank = ma .auto_field ()
82
82
buffer_type = ma .auto_field ()
83
83
device_id = ma .Function (lambda obj : obj .device .device_id )
84
- operation_id = ma .Function (lambda obj : obj .operation .operation_id )
85
84
86
85
87
86
class OperationSchema (ma .SQLAlchemySchema ):
@@ -96,7 +95,12 @@ class Meta:
96
95
outputs = ma .List (ma .Nested (OutputTensorSchema ()))
97
96
inputs = ma .List (ma .Nested (InputTensorSchema ()))
98
97
arguments = ma .List (ma .Nested (OperationArgumentsSchema ()))
98
+ stack_trace = ma .Method ("get_stack_trace" )
99
99
100
+ def get_stack_trace (self , obj ):
101
+ if obj .stack_trace and len (obj .stack_trace ):
102
+ return next (x for x in obj .stack_trace ).stack_trace
103
+ return ""
100
104
101
105
# Filesystem Schemas
102
106
class RemoteConnectionSchema (ma .Schema ):
You can’t perform that action at this time.
0 commit comments