MAINT: More cleanup of einsum (#11230)
MAINT: More cleanup of einsum (#11230)

* MAINT: Move call to get_single_op_view out of loop.

* MAINT: Refactor get_combined_dims_view.

Moves check for repeated labels in operands out of the main einsum loop
and into get_combined_dims_view. The code there is slightly simplified.

Also, fixes #11221 by only rewriting the labels array once all labels
have been processed.

* MAINT: Make _no_labels_are_negative parameter signed char.

* MAINT: address review comments.

* MAINT: Fix small bug after rebasing.

The view was being created with the same number of dimensions as
the original operand, instead of the number of unique labels.

pbrod/numpy,madphysicist/numpy,pbrod/numpy,jakirkham/numpy,simongibbons/numpy,seberg/numpy,endolith/numpy,jakirkham/numpy,jorisvandenbossche/numpy,numpy/numpy,WarrenWeckesser/numpy,mattip/numpy,mhvk/numpy,madphysicist/numpy,ahaldane/numpy,pizzathief/numpy,numpy/numpy,ahaldane/numpy,pbrod/numpy,pizzathief/numpy,simongibbons/numpy,MSeifert04/numpy,mhvk/numpy,pdebuyl/numpy,jorisvandenbossche/numpy,abalkin/numpy,jorisvandenbossche/numpy,mhvk/numpy,simongibbons/numpy,rgommers/numpy,pizzathief/numpy,pbrod/numpy,rgommers/numpy,pdebuyl/numpy,MSeifert04/numpy,rgommers/numpy,pdebuyl/numpy,charris/numpy,abalkin/numpy,numpy/numpy,ahaldane/numpy,mattip/numpy,WarrenWeckesser/numpy,jakirkham/numpy,pizzathief/numpy,seberg/numpy,endolith/numpy,MSeifert04/numpy,WarrenWeckesser/numpy,charris/numpy,mattip/numpy,anntzer/numpy,endolith/numpy,grlee77/numpy,mhvk/numpy,anntzer/numpy,shoyer/numpy,ahaldane/numpy,shoyer/numpy,ahaldane/numpy,numpy/numpy,jorisvandenbossche/numpy,jorisvandenbossche/numpy,grlee77/numpy,mhvk/numpy,mattip/numpy,madphysicist/numpy,shoyer/numpy,WarrenWeckesser/numpy,madphysicist/numpy,simongibbons/numpy,madphysicist/numpy,shoyer/numpy,anntzer/numpy,simongibbons/numpy,rgommers/numpy,MSeifert04/numpy,jakirkham/numpy,jakirkham/numpy,shoyer/numpy,abalkin/numpy,charris/numpy,WarrenWeckesser/numpy,seberg/numpy,grlee77/numpy,anntzer/numpy,MSeifert04/numpy,seberg/numpy,pdebuyl/numpy,endolith/numpy,grlee77/numpy,grlee77/numpy,pizzathief/numpy,pbrod/numpy,charris/numpy