def METHOD_NAME(x):
    if isinstance(x, KerasTensor):
        return tf.compat.v1.placeholder(
            shape=x.shape, dtype=x.dtype
        )
    if isinstance(x, types.FunctionType):
        def _fn(*x_args, **x_kwargs):
            out = x(*x_args, **x_kwargs)
            out = METHOD_NAME(out)
            return out
        return _fn
    return x