"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "02ba50c6104d40b745163fd14e84214b3db90112"
Commit ea93767d authored by Carl Case's avatar Carl Case
Browse files

1804 RNN fix

parent 1737ce1e
...@@ -138,7 +138,7 @@ def rnn_cast(backend, fn, verbose=False): ...@@ -138,7 +138,7 @@ def rnn_cast(backend, fn, verbose=False):
# autograd graph correctly backprops from the wgrads computed # autograd graph correctly backprops from the wgrads computed
# inside cuDNN (on fp16 weights) into the fp32 weights. # inside cuDNN (on fp16 weights) into the fp32 weights.
assert utils.type_string(flat_weight) == 'FloatTensor' assert utils.type_string(flat_weight) == 'FloatTensor'
if compat.tensor_is_float_tensor(): if compat.tensor_is_float_tensor() or compat.tensor_is_variable():
# Pre-0.4. A little slower, since it zeros out memory. # Pre-0.4. A little slower, since it zeros out memory.
flat_weight_fp16 = flat_weight.new().half().resize_(flat_weight.shape) flat_weight_fp16 = flat_weight.new().half().resize_(flat_weight.shape)
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment