A deep network construction that adapts to intrinsic dimensionality beyond the domain