Deep neural networks (DNNs) have been introduced for designing wireless policies by approximating the mappings from environmental parameters to solutions of optimization problems. Considering that labeled training samples are hard to obtain, unsupervised deep learning has been proposed to solve functional optimization problems with statistical constraints recently. However, most existing problems in wireless communications are variable optimizations, and many problems are with instantaneous constraints. In this paper, we establish a unified framework of using unsupervised deep learning to solve both kinds of problems with both instantaneous and statistic constraints 1 . For a constrained variable optimization, we first convert it into an equivalent functional optimization problem with instantaneous constraints. Then, to ensure the instantaneous constraints in the functional optimization problems, we use DNN to approximate the Lagrange multiplier functions, which is trained together with a DNN to approximate the policy. We take two resource allocation problems in ultrareliable and low‐latency communications as examples to illustrate how to guarantee the complex and stringent quality‐of‐service (QoS) constraints with the framework. Simulation results show that unsupervised learning outperforms supervised learning in terms of QoS violation probability and approximation accuracy of the optimal policy, and can converge rapidly with pre‐training.