model.state_dict()  basically stores weights. For example in my RNN model :
odict_keys(['i2h.weight', 'h2h.weight', 'h2o.weight']). You can reach what model.state_dict()  stores with model.state_dict().keys(). I think you can do like that :
first_layer_name = list(model.state_dict().keys())[0]
input_dim = model.state_dict()[first_layer_name].size()[1]
# since weights are in the form of (hid_dim x input_dim) instead of (input_dim x hid_dim)
# we use .size[1] instead of .size[0]

You can also do same thing for hidden layer dimension.