| 95 | |
| 96 | |
| 97 | class OperatorEngine: |
| 98 | def __init__(self, name): |
| 99 | self.op_name = name |
| 100 | self.base_op_name, self.engine = name.split("_ENGINE_", 1) |
| 101 | |
| 102 | def getDeviceImpl(self): |
| 103 | deviceImplList = [] |
| 104 | for device, impl in [('CPU', OpSchema.get_cpu_impl(self.op_name)), |
| 105 | ('CUDA', OpSchema.get_cuda_impl(self.op_name))]: |
| 106 | if not impl: |
| 107 | continue |
| 108 | deviceImplList.append((device, impl)) |
| 109 | return deviceImplList |
| 110 | |
| 111 | def generateDoc(self, formatter): |
| 112 | for device, impl in self.getDeviceImpl(): |
| 113 | formatter.addLine( |
| 114 | '{engine} on {device}: {impl}'.format(engine=self.engine, |
| 115 | device=device, |
| 116 | impl=impl)) |
| 117 | |
| 118 | |
| 119 | class OperatorDoc: |
no outgoing calls
no test coverage detected
searching dependent graphs…