错误提示:ValueError: When using JIT Fallback to handle script 'sum(pow(img_hash - sign(img_hash), 2))', the inputs should be constant, but found variable 'img_hash' to be nonconstant.
Mindspore中对Python的原生函数有独立支持,编译时会优先编译成原生函数,命名时一定要注意,例如:
sum = ops.ReduceSum() #sum()是python原生函数,换一个命名即可
sum_ = ops.ReduceSum()