I found there are 3 types of keras when I want to import keras: "keras", "tensorflow.keras" and "tensorflow.python.keras".
I always use 'import keras' directly. But I want to know if I made some modifications on the tf.gradients, would my keras model be affected? For example, I want to use a package named 'gradient-checkpointing' which need to replace the default tf_gradients by customized gradients:
from tensorflow.python.ops import gradients as tf_gradients
tf_gradients.gradients = gc.gradients_speed
But If I use 'import keras' to build model, would my keras-based model call the new gc.gradients_speed??
Update: I know 'tf.keras' is recommended for normal user. I also know that 'tf.python.keras' is private and is just used by developmenters. But here I want to use my own customerzed gradients strategy which requires 'tf.python.ops.gradients'. So my question is: if I use modified 'tf.python.ops.gradients', which 'keras' would be affected? 'tf.keras'? or 'keras' ? or 'tf.python.keras'? (I hope to choose one keras which calls 'tf.python.ops.gradients' so that I can verify if my customerzed gradient actually works.