You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DeviceContext* cpu_ctx = new CPUDeviceContext();
DeviceContext* gpu_ctx = new CUDADeviceContext();
auto scope = std::make_shared<Scope>();
OperatorBase* op = paddle::framework::OpRegistry::CreateOp(op_desc);
// will run on cpu kernel
op->Run(scope, cpu_ctx);
// will run on gpu kernel
op->Run(scope, gpu_ctx);
The text was updated successfully, but these errors were encountered:
Add OperatorBase.
issue: #2790
Paddle design the Operator with Kernel. OperatorBase has no type and device information when create, One operator can have multiple kernels, Operator will choose a kernel to run according to context. The kernel should be bind to Operator before or during Operator running.
一个带kernel的op的demo cos_op
有两种实现Op的方式:
上述两种方式的区别:
不同框架对比:
实现kernel带来的问题:
集中框架的对比。
一个demo op的实现
简单带kernel的Op的运行方式:
op的运行
The text was updated successfully, but these errors were encountered: