def speed_elemwise_collapse():
 shape = (30, 40, 50, 600)
 a = cuda_ndarray.CudaNdarray(theano._asarray(numpy.random.rand(*shape), dtype='float32'))
 a = theano._asarray(numpy.random.rand(*shape), dtype='float32')
 a2 = tcn.shared_constructor(a, 'a')
 a3 = a2[:, ::2, :, :]
 b = tcn.CudaNdarrayType((False, False, False, False))()
 c = (a3 + (b * tensor.exp((1 + (b ** a3)))))
 f = pfunc([b], [c], mode=mode_with_gpu)
 v = theano._asarray(numpy.random.rand(*shape), dtype='float32')
 v = v[:, ::2, :, :]
 v = cuda_ndarray.CudaNdarray(v)
 time.time()
 for i in range(100):
  f(v)
 time.time()

def speed_elemwise_collapse ( ) : shape = ( 30 , 40 , 50 , 600 ) a = cuda_ndarray . CudaNdarray ( theano . _asarray ( numpy . random . rand ( * shape ) , dtype = 'float32' ) ) a = theano . _asarray ( numpy . random . rand ( * shape ) , dtype = 'float32' ) a2 = tcn . shared_constructor ( a , 'a' ) a3 = a2 [ : , : : 2 , : , : ] b = tcn . CudaNdarrayType ( ( False , False , False , False ) ) ( ) c = ( a3 + ( b * tensor . exp ( ( 1 + ( b ** a3 ) ) ) ) ) f = pfunc ( [ b ] , [ c ] , mode = mode_with_gpu ) v = theano . _asarray ( numpy . random . rand ( * shape ) , dtype = 'float32' ) v = v [ : , : : 2 , : , : ] v = cuda_ndarray . CudaNdarray ( v ) time . time ( ) for i in range ( 100 ) : f ( v ) time . time ( )
used to time if the collapse of ccontiguous dims are useful .