I have a question about the code in Recommending movies: ranking | TensorFlow Recommenders
class MovielensModel
def compute_loss(...):
rating_predictions = self(features) # here
My understanding is that Python self() invokes self.__call__()
method.
In MovielensModel class, call() is defined instead. Does self(features) eventually invoke call() under the hood?
Thus, is it equivalent to call it directly like this?
rating_predictions = self.call(features)
In fact, in this video, call() is not defined but inlined in compute_loss().
What is the idiomatic way to do that?