Sim-to-Real Transfer of Robot Learning with Variable Length Inputs