I was wondering if there is any other way to write my own Keras layer instead of inheritance way as given in their documentation? My colleague is more comfortable in tensorflow and he gave me a tensorflow function that does the job of the layer. Do I necessarily have to rewrite it as Keras' inherited layer?
Depends on what keras you are using. If you are using Keras (not tf Keras), then you have to inherit from Keras Layer. This behaviour is. One of the reason for this behaviour is Keras wants their framework to support multiple backend (although I have never seen people changing backend midway). Think of keras as a middleman and backend as the worker, and by using keras you are communicating with the middleman and then keras will relay it to the worker and hence you must use the language that the middleman understands.
Tensorflow 2.0 offers tf-keras as its high-level api. You can mix and match tensorflow functions and keras layers(only if you import it from tf.keras). This might be what you are looking for.