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):
117117
118118class Buffer (db .Model ):
119119 __table__ = buffers
120-
120+ device = relationship ( "Device" )
121121
122122class InputTensor (db .Model ):
123123 __table__ = input_tensors
@@ -139,6 +139,7 @@ class Operation(db.Model):
139139 inputs = db .relationship ("InputTensor" , lazy = "joined" )
140140 outputs = db .relationship ("OutputTensor" , lazy = "joined" )
141141 stack_trace = db .relationship ("StackTrace" )
142+ buffers = db .relationship ("Buffer" )
142143
143144
144145class OperationArgument (db .Model ):
Original file line number Diff line number Diff line change @@ -81,7 +81,6 @@ class Meta:
8181 max_size_per_bank = ma .auto_field ()
8282 buffer_type = ma .auto_field ()
8383 device_id = ma .Function (lambda obj : obj .device .device_id )
84- operation_id = ma .Function (lambda obj : obj .operation .operation_id )
8584
8685
8786class OperationSchema (ma .SQLAlchemySchema ):
@@ -96,7 +95,12 @@ class Meta:
9695 outputs = ma .List (ma .Nested (OutputTensorSchema ()))
9796 inputs = ma .List (ma .Nested (InputTensorSchema ()))
9897 arguments = ma .List (ma .Nested (OperationArgumentsSchema ()))
98+ stack_trace = ma .Method ("get_stack_trace" )
9999
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 ""
100104
101105# Filesystem Schemas
102106class RemoteConnectionSchema (ma .Schema ):
You can’t perform that action at this time.
0 commit comments