def _make_tensor_descriptor_array(xs):
 descs = []
 for x in xs:
  if (x.ndim < 3):
   shape = (x.shape + ((1,) * (3 - x.ndim)))
   x = x.reshape(shape)
  desc = cudnn.create_tensor_nd_descriptor(x)
  descs.append(desc)
 return PointerArray([d.value for d in descs], descs)

def _make_tensor_descriptor_array ( xs ) : descs = [ ] for x in xs : if ( x . ndim < 3 ) : shape = ( x . shape + ( ( 1 , ) * ( 3 - x . ndim ) ) ) x = x . reshape ( shape ) desc = cudnn . create_tensor_nd_descriptor ( x ) descs . append ( desc ) return PointerArray ( [ d . value for d in descs ] , descs )
make an array of pointers denoting pointers of tensor descriptors .