提交 2ca6a3d7 authored 作者: Guillaume Desjardins's avatar Guillaume Desjardins

Added comments to Erfinv=>ErfinvGPU optimization

上级 7f3ea07c
......@@ -1025,7 +1025,15 @@ nd_collapse_[i]=0;
class ErfinvGPU(Erfinv):
"""
Provides a c-code implementation of the inverse error function for GPU.
Note: We do not add this c_code to theano.scalar.basic_scipy.Erfinv, as we
currently rely on Nvidia's cublas library to provide the erfinv
c-implementation (which requires different c_headers). As it stands,
theano.scalar.basic_scipy.Erfinv does not have c_code as scipy does not
export the required C function
"""
def c_libraries(self):
return ['math.h']
......
......@@ -78,6 +78,15 @@ erfc = Erfc(upgrade_to_float_no_complex, name='erfc')
class Erfinv(UnaryScalarOp):
"""
Implements the inverse error function.
Note: This op can still be executed on GPU, despite not having c_code. When
running on GPU, sandbox.cuda.opt.local_gpu_elemwise_[0,1] replaces this op
with sandbox.cuda.elemwise.ErfinvGPU.
(TODO) Find a C implementation of erfinv for CPU.
"""
def impl(self, x):
if imported_scipy_special:
return scipy.special.erfinv(x)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论