What is difference between 'call' and '__call__' in TensorFlow BasicLSTMCell implementation?

ε祈祈猫儿з 提交于 2019-12-11 08:42:29

问题


I am studying Tensorflow BasicLSTMCell while I found that there are two similar methods within the class: __call__ and call. The two methods has the same parameters and the documentation does not say the difference. Refering the source code does not give me any clue of this. But I am guessing that the the __call__ method is inherited from somewhere, and call overrides __call__. If this is the case, why not just use __call__ instead of call in the source code?


回答1:


I ran into similar problem when studying RNNCell.

It is in Class Layer in base_layer.py that __call__ wraps in call, "applying pre- and post-processing steps".



来源:https://stackoverflow.com/questions/50989895/what-is-difference-between-call-and-call-in-tensorflow-basiclstmcell-imp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!