Catalysis of the reactions: pyranose + acceptor = 2-dehydropyranose (or 3-dehydropyranose or 2,3-didehydropyranose) + reduced acceptor, and a pyranoside + acceptor = a 3-dehydropyranoside (or 3,4-didehydropyranoside) + reduced acceptor.