No. Shape is a vector. The user could provide a vector of the wrong shape. It must be of length x.ndim. This check is also done in the perform. Here we do a check at graph build time to give user an error more rapidly then at run time.