@constructor
def shape_padaxis(t, axis):
 _t = as_tensor_variable(t)
 ndim = (_t.ndim + 1)
 if (not ((- ndim) <= axis < ndim)):
  msg = 'axis {0} is out of bounds [-{1}, {1})'.format(axis, ndim)
  raise IndexError(msg)
 if (axis < 0):
  axis += ndim
 pattern = [i for i in xrange(_t.type.ndim)]
 pattern.insert(axis, 'x')
 return DimShuffle(_t.broadcastable, pattern)(_t)

@ constructor def shape_padaxis ( t , axis ) : _t = as_tensor_variable ( t ) ndim = ( _t . ndim + 1 ) if ( not ( ( - ndim ) <= axis < ndim ) ) : msg = 'axis {0} is out of bounds [-{1}, {1})' . format ( axis , ndim ) raise IndexError ( msg ) if ( axis < 0 ) : axis += ndim pattern = [ i for i in xrange ( _t . type . ndim ) ] pattern . insert ( axis , 'x' ) return DimShuffle ( _t . broadcastable , pattern ) ( _t )
reshape t by inserting 1 at the dimension axis .