  We propose a new method to deal with the essential boundary conditions
encountered in the deep learning-based numerical solvers for partial
differential equations. The trial functions representing by deep neural
networks are non-interpolatory, which makes the enforcement of the essential
boundary conditions a nontrivial matter. Our method resorts to Nitsche's
variational formulation to deal with this difficulty, which is consistent, and
does not require significant extra computational costs. We prove the error
estimate in the energy norm and illustrate the method on several representative
problems posed in at most 100 dimension.
