Did 'tf.keras.layers.Flatten()' is the same things with 'layers.Flatten()'

[code removed - moderator]

the code in the pic above is part of the lab1 week3 content.
this confuse me before week3 we use ’ tf.keras.layers.Flatten() ', but ’ x = layers.Flatten ’ been used here, is that legal? and what’s the difference between this two ways?

Thanks a lot,my english isn’t fluently, if u haven’t get my point, plz comment below

Please read this and this.

thanks, that’s helpful !