Use safe_as_int to check provided output shape