The paper is devoted to systematic study of the $\chi$-capacity (underlying the classical capacity) of infinite dimensional quantum channels. An essential feature of this case is the natural appearance of the input constraints and infinite, in general, ``continuous'' state ensembles, defined as probability measures on the set of all quantum states. By using compactness criteria from probability theory and operator theory it is shown that the set of all generalized ensembles with the average (barycenter) in a compact set of states is itself a compact subset of the set of all probability measures. With this in hand we give a sufficient condition for the existence of an optimal generalized ensemble for a constrained quantum channel. This condition can be verified in the case of Bosonic Gaussian channels with constrained mean energy. The importance of the above condition is shown by considering example of a constrained channel with no optimal generalized ensemble. In the case of convex constraints a characterization of the optimal generalized ensemble is obtained extending the `` maximal distance'' property.