提交 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): ...@@ -442,7 +442,7 @@ class GpuCrossentropySoftmax1HotWithBiasDx(Op):
gpu_crossentropy_softmax_1hot_with_bias_dx = GpuCrossentropySoftmax1HotWithBiasDx() gpu_crossentropy_softmax_1hot_with_bias_dx = GpuCrossentropySoftmax1HotWithBiasDx()
class GpuSoftmax (GpuOp): class GpuSoftmax (Op):
""" """
Implement Softmax on the gpu. Implement Softmax on the gpu.
""" """
...@@ -463,6 +463,12 @@ class GpuSoftmax (GpuOp): ...@@ -463,6 +463,12 @@ class GpuSoftmax (GpuOp):
def c_code_cache_version(self): def c_code_cache_version(self):
return (9,) + inline_softmax.code_version 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): def c_code(self, node, nodename, inp, out, sub):
x, = inp x, = inp
...@@ -628,6 +634,12 @@ class GpuSoftmaxWithBias (GpuOp): ...@@ -628,6 +634,12 @@ class GpuSoftmaxWithBias (GpuOp):
def c_code_cache_version(self): def c_code_cache_version(self):
#return () #return ()
return (8,) + inline_softmax.code_version 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): def c_code(self, node, nodename, inp, out, sub):
x, b = inp x, b = inp
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论