MCPcopy Create free account
hub / github.com/pytorch/pytorch / OperatorEngine

Class OperatorEngine

caffe2/python/docs/generator.py:97–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

95
96
97class 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
119class OperatorDoc:

Callers 1

getOperatorEngineMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…