I have build a module to change field size (actually very long), but can't do it. Have tried everything.

form['field_group']['field_name']['#size'] = 5;
form['field_group']['field_name'][0]['#size'] = 5;
form['field_name']['#size'] = 5;
form['field_name']['size'] = 5;