Merge pull request #7284 from pkuyym/fix-7211

Stop gradient when pool_type=='max'
detection_output_fixbug
Tao Luo 7 years ago committed by GitHub
commit 41307c738d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -816,6 +816,11 @@ def sequence_pool(input, pool_type, **kwargs):
"MaxIndex": max_index},
attrs={"pooltype": pool_type.upper()})
# when pool_type is max, variable max_index is initialized,
# so we stop the gradient explicitly here
if pool_type == 'max':
max_index.stop_gradient = True
return pool_out

Loading…
Cancel
Save