Boundary tensor renormalization group