The example I cited seems to have two layers of dense having size 128, 10 respectively.
But in the torch example, user defines linear wiht 128, 10 with one linear.

  
    
    
    Pytorch equivalent of Keras 
  
  
    I’m trying to convert CNN model code from Keras to Pytorch. 
here is the original keras model: 
input_shape = (28, 28, 1)
model = Sequential()
model.add(Conv2D(28, kernel_size=(3,3), input_shape=input_shape))
model.add(MaxPooling2D(pool_size=(2, 2)))
model.add(Flatten()) # Flattening the 2D arrays for fully connected layers
model.add(Dense(128, activation=tf.nn.relu))
model.add(Dropout(0.2))
model.add(Dense(10,activation=tf.nn.softmax))

And this is my Pytorch model, and I am not sure am I doing…
  


Now I visited more elaborate definition:
pytorch nn linear layer inputs:
CLASS torch.nn. Linear (in_features , out_features , bias=True , device=None , dtype=None )
keras dense:
tf.keras.layers.Dense(    units, activation=None, use_bias=True,    kernel_initializer='glorot_uniform',    bias_initializer='zeros', kernel_regularizer=None,    bias_regularizer=None, activity_regularizer=None, kernel_constraint=None,    bias_constraint=None, **kwargs)

Here in keras.dense layer: units is defined as: “Positive integer, dimensionality of the output space.”
Here the keyword is output: does it mean this parameter is equivalent to out_features in pytorch nn? Then what should be “in_features*”?