提交 611b6c70 authored 作者: James Bergstra's avatar James Bergstra

Fixed sigmoid and softmax ops to include their parent code version in their

own code-version identifier
上级 fbac37c6
...@@ -43,7 +43,11 @@ class ScalarSigmoid(scalar.UnaryScalarOp): ...@@ -43,7 +43,11 @@ class ScalarSigmoid(scalar.UnaryScalarOp):
else: else:
raise NotImplementedError('only floatingpoint is implemented') raise NotImplementedError('only floatingpoint is implemented')
def c_code_cache_version(self): def c_code_cache_version(self):
return (2,) v = super(ScalarSigmoid, self).c_code_cache_version()
if v:
return (2,) + v
else:
return v
scalar_sigmoid = ScalarSigmoid(scalar.upgrade_to_float, name='scalar_sigmoid') scalar_sigmoid = ScalarSigmoid(scalar.upgrade_to_float, name='scalar_sigmoid')
sigmoid = elemwise.Elemwise(scalar_sigmoid, name='sigmoid') sigmoid = elemwise.Elemwise(scalar_sigmoid, name='sigmoid')
...@@ -74,7 +78,11 @@ class ScalarSoftplus(scalar.UnaryScalarOp): ...@@ -74,7 +78,11 @@ class ScalarSoftplus(scalar.UnaryScalarOp):
else: else:
raise NotImplementedError('only floatingpoint is implemented') raise NotImplementedError('only floatingpoint is implemented')
def c_code_cache_version(self): def c_code_cache_version(self):
return (2,) v = super(ScalarSoftplus, self).c_code_cache_version()
if v:
return (2,) + v
else:
return v
scalar_softplus = ScalarSoftplus(scalar.upgrade_to_float, name='scalar_softplus') scalar_softplus = ScalarSoftplus(scalar.upgrade_to_float, name='scalar_softplus')
softplus = elemwise.Elemwise(scalar_softplus, name='softplus') softplus = elemwise.Elemwise(scalar_softplus, name='softplus')
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论