3-python-gpu-op.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:Deep-Learning-with-Theano 作者: PacktPublishing 项目源码 文件源码
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()])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号