| 108 | |
| 109 | |
| 110 | class DLTensorOpPipeline(CommonPipeline): |
| 111 | def __init__(self, function, device, synchronize=True): |
| 112 | super(DLTensorOpPipeline, self).__init__(device) |
| 113 | self.op = ops.DLTensorPythonFunction( |
| 114 | function=function, device=device, num_outputs=2, synchronize_stream=synchronize |
| 115 | ) |
| 116 | |
| 117 | def define_graph(self): |
| 118 | im = self.load() |
| 119 | im2 = self.load() |
| 120 | return self.op(im, self.flip(im2)) |
| 121 | |
| 122 | |
| 123 | def pytorch_adapter(fun, in1, in2): |