What does self(features) in the TensorFlow recommender rating sample code?

I have a question about the code in Recomendar películas: clasificación  |  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?

Yes the sequence is obj(args) > obj.__call_(args) > obj.call(args).

__call__ handlkes a bunch of Keras details, and then dispatches to the layer’s call.

2 Likes