Add support for single-elements itypes and otypes and optional infer_shape callable.