I have had adequate understanding of creating nn in tensorflow but I have tried to port it to pytorch equivalent.
My tflow examples has following layers:
input->flatten->dense(300 nodes)->dense(100 nodes) but I can not get the dense layer definition in pytorch.nn. The web search seem to show or equate the nn.linear to dense but I am not sure.
Here are all layers in pytorch nn:
https://pytorch.org/docs/stable/nn.html 9
Now I concede the tensorflow example that I have uses really a keras so here are the keras/tensorflow definitions of its layers:
  
      

      TensorFlow
  

  
    

tf.keras.layers.Layer  |  TensorFlow Core v2.6.0 1

  This is the class from which all layers inherit.