(start=0)
return wrap
Concatenate the numpy array inputs to the functions.

    Parameters
    ----------
    start : int, optional
        The attribute number at which to start concatenating.
Concatenate the numpy array inputs to the functions.
Concatenate the numpy array inputs to the functions .
def concatenate_inputs(start=0):
    """Concatenate the numpy array inputs to the functions.

    Parameters
    ----------
    start : int, optional
        The attribute number at which to start concatenating.
    """
    def wrap(function):
        @wraps(function)
        def wrapped_function(*args, **kwargs):
            """Concatenate the input arguments."""
            nargs = len(args) - start
            # Check for tensorflow objects
            tf_objects = (tf.Tensor, tf.Variable)
            if any(isinstance(arg, tf_objects) for arg in args[start:]):
                # reduce number of function calls in graph
                if nargs == 1:
                    return function(*args, **kwargs)
                # concatenate extra arguments
                args = args[:start] + (tf.concat(args[start:], axis=1),)
                return function(*args, **kwargs)
            else:
                # Map to 2D objects
                to_concatenate = map(np.atleast_2d, args[start:])

                if nargs == 1:
                    concatenated = tuple(to_concatenate)
                else:
                    concatenated = (np.hstack(to_concatenate),)

                args = args[:start] + concatenated
                return function(*args, **kwargs)

        return wrapped_function

    return wrap
def concatenate_inputs ( start = 0 ) : def wrap ( function ) : @ wraps ( function ) def wrapped_function ( * args , * * kwargs ) : """Concatenate the input arguments.""" nargs = len ( args ) - start # Check for tensorflow objects tf_objects = ( tf . Tensor , tf . Variable ) if any ( isinstance ( arg , tf_objects ) for arg in args [ start : ] ) : # reduce number of function calls in graph if nargs == 1 : return function ( * args , * * kwargs ) # concatenate extra arguments args = args [ : start ] + ( tf . concat ( args [ start : ] , axis = 1 ) , ) return function ( * args , * * kwargs ) else : # Map to 2D objects to_concatenate = map ( np . atleast_2d , args [ start : ] ) if nargs == 1 : concatenated = tuple ( to_concatenate ) else : concatenated = ( np . hstack ( to_concatenate ) , ) args = args [ : start ] + concatenated return function ( * args , * * kwargs ) return wrapped_function return wrap