def ix_(*args):
 out = []
 nd = len(args)
 for (k, new) in enumerate(args):
  new = cupy.asarray(new)
  if (new.ndim != 1):
   raise ValueError('Cross index must be 1 dimensional')
  if (new.size == 0):
   new = new.astype(numpy.intp)
  if cupy.issubdtype(new.dtype, cupy.bool_):
   (new,) = new.nonzero()
  new = new.reshape(((((1,) * k) + (new.size,)) + ((1,) * ((nd - k) - 1))))
  out.append(new)
 return tuple(out)

def ix_ ( * args ) : out = [ ] nd = len ( args ) for ( k , new ) in enumerate ( args ) : new = cupy . asarray ( new ) if ( new . ndim != 1 ) : raise ValueError ( 'Cross index must be 1 dimensional' ) if ( new . size == 0 ) : new = new . astype ( numpy . intp ) if cupy . issubdtype ( new . dtype , cupy . bool_ ) : ( new , ) = new . nonzero ( ) new = new . reshape ( ( ( ( ( 1 , ) * k ) + ( new . size , ) ) + ( ( 1 , ) * ( ( nd - k ) - 1 ) ) ) ) out . append ( new ) return tuple ( out )
construct an open mesh from multiple sequences .