def create_const(value, size, sparse=False):
 if (size == (1, 1)):
  op_type = lo.SCALAR_CONST
  if (not np.isscalar(value)):
   value = value[(0, 0)]
 elif sparse:
  op_type = lo.SPARSE_CONST
 else:
  op_type = lo.DENSE_CONST
 return lo.LinOp(op_type, size, [], value)

def create_const ( value , size , sparse = False ) : if ( size == ( 1 , 1 ) ) : op_type = lo . SCALAR_CONST if ( not np . isscalar ( value ) ) : value = value [ ( 0 , 0 ) ] elif sparse : op_type = lo . SPARSE_CONST else : op_type = lo . DENSE_CONST return lo . LinOp ( op_type , size , [ ] , value )
wraps a constant .