def check_theano_variable(variable, n_dim, dtype_prefix):
 if (variable is None):
  return
 if (not isinstance(variable, tensor.Variable)):
  variable = tensor.as_tensor_variable(variable)
 if (n_dim and (variable.ndim != n_dim)):
  raise ValueError('Wrong number of dimensions:\n DCTB expected {}, got {}'.format(n_dim, variable.ndim))
 if (dtype_prefix and (not variable.dtype.startswith(dtype_prefix))):
  raise ValueError('Wrong dtype prefix:\n DCTB expected starting with {}, got {}'.format(dtype_prefix, variable.dtype))

def check_theano_variable ( variable , n_dim , dtype_prefix ) : if ( variable is None ) : return if ( not isinstance ( variable , tensor . Variable ) ) : variable = tensor . as_tensor_variable ( variable ) if ( n_dim and ( variable . ndim != n_dim ) ) : raise ValueError ( 'Wrong number of dimensions:\n DCTB expected {}, got {}' . format ( n_dim , variable . ndim ) ) if ( dtype_prefix and ( not variable . dtype . startswith ( dtype_prefix ) ) ) : raise ValueError ( 'Wrong dtype prefix:\n DCTB expected starting with {}, got {}' . format ( dtype_prefix , variable . dtype ) )
check number of dimensions and dtype of a theano variable .