def make_node(self, x):
x = as_gpuarray_variable(x, self.context_name)
x_arg = pygpu.elemwise.arg('x', 'float32', read=True)
c_arg = pygpu.elemwise.arg('c', 'float32', read=True, write=True)
self.my_op = pygpu.elemwise.GpuElemwise(get_context(self.context_name), "c = " + str(self.a) + " * x + " + str(self.b), [x_arg, c_arg], convert_f16=True)
return Apply(self, [x], [x.type()])
3-python-gpu-op.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录