or an outer product depending on whether indices are shared between or among the tensors