ifelse私はスクリプトlstm_ptb.pyを実行しようとしていますが、それは次の行のためにはTypeErrorを投げている:Theano:例外TypeError
shrink_factor = ifelse(T.gt(norm_gparams,max_grad_norm),max_grad_norm/norm_gparams,1.)
これは、この行を達成しようとしているものです。
if norm_gparams > max_grad_norm:
shrink_factor = max_grad_norm/norm_gparams
else:
shrink_factor = 1.
それは言う:
TypeError: The two branches should have identical types, but they are TensorType(float64, scalar) and TensorType(float32, scalar) respectively. This error could be raised if for example you provided a one element list on the
then
branch but a tensor on theelse
branch
どうすればエラーを解決してください?お返事は