def outer(a, b, out=None):
 n = a.size
 m = b.size
 ret_shape = (n, m)
 if (out is None):
  return core.tensordot_core(a, b, None, n, m, 1, ret_shape)
 if (out.size != (n * m)):
  raise ValueError('Output array has an invalid size')
 if out.flags.c_contiguous:
  return core.tensordot_core(a, b, out, n, m, 1, ret_shape)
 else:
  out[:] = core.tensordot_core(a, b, None, n, m, 1, ret_shape)
  return out

def outer ( a , b , out = None ) : n = a . size m = b . size ret_shape = ( n , m ) if ( out is None ) : return core . tensordot_core ( a , b , None , n , m , 1 , ret_shape ) if ( out . size != ( n * m ) ) : raise ValueError ( 'Output array has an invalid size' ) if out . flags . c_contiguous : return core . tensordot_core ( a , b , out , n , m , 1 , ret_shape ) else : out [ : ] = core . tensordot_core ( a , b , None , n , m , 1 , ret_shape ) return out
outer product convenience wrapper for vector .