提交 054aa55a authored 作者: Frederic Bastien's avatar Frederic Bastien

Better doc

上级 6fc0f59a
......@@ -213,8 +213,12 @@ class IfElse(PureOp):
gpu=self.gpu,
name=nw_name_f)
# The grads can have a different type then the inputs.
# As all condition must have the same dtype, we must
# The grads can have a different dtype then the inputs.
# As all inputs except the condition must have the same dtype,
# we must cast the zeros to the grad dtype and not the input dtype.
# We hope that each grads have the same dtype and none had its
# dtype changed differently then the others. This could happen
# in theory.
dtype = grads[0].dtype
if_true = ([ins[0]] +
grads +
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论