Recognize dimension automatically.