Variational formulations of ODE-Net as a mean-field optimal control problem and existence results