如何理解 Imagenet 预处理的 TensorFlow 源码

How to understand TensorFlow source code for Imagenet preprocessing

我想了解并复制tensorflow.keras如何在函数tf.keras.applications.resnet.preprocess_input, but I can not understand the source code:

中对imagenet进行预处理
@keras_export('keras.applications.imagenet_utils.preprocess_input')
@keras_modules_injection
def preprocess_input(*args, **kwargs):
  return imagenet_utils.preprocess_input(*args, **kwargs)

这个定义似乎是递归的。此外,文档没有说明该功能。我怎样才能看到这个函数到底在做什么?

我认为这 link 会有所帮助。 https://github.com/keras-team/keras-applications/blob/master/keras_applications/imagenet_utils.py。该定义实际上不是递归的,因为导入语句 from keras_applications import imagenet_utils 将允许您使用位于 keras 中的 imagenet_utils 中的 preprocess_input 函数,而不是调用自身。