提交 1a5bfac6 authored 作者: Olivier Breuleux's avatar Olivier Breuleux

added log

上级 5319c2a2
...@@ -45,6 +45,7 @@ def experimental_linker(env, target = None): ...@@ -45,6 +45,7 @@ def experimental_linker(env, target = None):
else: else:
raise NotImplementedError("Cannot write thunk representation to a file.") raise NotImplementedError("Cannot write thunk representation to a file.")
# def experimental_linker(env, target = None): # def experimental_linker(env, target = None):
# def fetch(op): # def fetch(op):
# try: # try:
......
...@@ -794,6 +794,14 @@ class exp(elemwise): ...@@ -794,6 +794,14 @@ class exp(elemwise):
return "z_i = exp(x_i);" return "z_i = exp(x_i);"
## Logarithm ##
class log(elemwise):
impl = numpy.log
def c_foreach((x_i, ), (z_i, )):
return "z_i = log(x_i);"
## Element-wise division ## ## Element-wise division ##
class div_elemwise(elemwise): class div_elemwise(elemwise):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论