提交 cc2cdc3f authored 作者: Pierre Luc Carrier's avatar Pierre Luc Carrier

Changed parent classes and added methods c_headers() and c_compiler() to ops…

Changed parent classes and added methods c_headers() and c_compiler() to ops GpuSoftmax and GpuSoftmaxWithBias.
上级 c732ec38
......@@ -442,7 +442,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(Op):
gpu_crossentropy_softmax_1hot_with_bias_dx = GpuCrossentropySoftmax1HotWithBiasDx()
class GpuSoftmax (GpuOp):
class GpuSoftmax (Op):
"""
Implement Softmax on the gpu.
"""
......@@ -464,6 +464,12 @@ class GpuSoftmax (GpuOp):
def c_code_cache_version(self):
return (9,) + inline_softmax.code_version
def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<compyte/numpy_compat.h>']
def c_compiler(self):
return NVCC_compiler
def c_code(self, node, nodename, inp, out, sub):
x, = inp
z, = out
......@@ -629,6 +635,12 @@ class GpuSoftmaxWithBias (GpuOp):
#return ()
return (8,) + inline_softmax.code_version
def c_headers(self):
return ['cuda.h', '<compyte/extension.h>', '<compyte/numpy_compat.h>']
def c_compiler(self):
return NVCC_compiler
def c_code(self, node, nodename, inp, out, sub):
x, b = inp
z, = out
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论