parameters: (decay_steps)
return_statement: return linear_decay_fn
docstring: Returns a function that computes a linear decay.
  
    This decay computes linear annealing:
      max(0, (decay_steps - global_step) / decay_steps)
  
    Example usage:
    ```
    decay_steps = 1000
    linear_decay_fn = get_linear_decay_fn(decay_steps)
    decayed = linear_decay_fn(global_step)
    x *= decayed
    ```
    Args:
      decay_steps: number of steps to decay over.
    Returns:
      linear_decay_fn: a function that computes the linear decay.
docstring_summary: Returns a function that computes a linear decay.
docstring_tokens: Returns a function that computes a linear decay .
function: def get_linear_decay_fn(decay_steps):
    """Returns a function that computes a linear decay.
  
    This decay computes linear annealing:
      max(0, (decay_steps - global_step) / decay_steps)
  
    Example usage:
    ```
    decay_steps = 1000
    linear_decay_fn = get_linear_decay_fn(decay_steps)
    decayed = linear_decay_fn(global_step)
    x *= decayed
    ```
    Args:
      decay_steps: number of steps to decay over.
    Returns:
      linear_decay_fn: a function that computes the linear decay.
    """
    # pylint:disable=missing-docstring
    def linear_decay_fn(global_step):
      if global_step is None:
        raise ValueError("global_step is required for linear_decay.")
      global_step = math_ops.minimum(global_step, decay_steps)
      remaining_steps = math_ops.cast(
          decay_steps, dtypes.int32) - math_ops.cast(global_step, dtypes.int32)
      decayed = (math_ops.cast(remaining_steps, dtypes.float32) /
                 math_ops.cast(decay_steps, dtypes.float32))
      return math_ops.maximum(0.0, decayed)
    # pylint:enable=missing-docstring
    return linear_decay_fn
function_tokens: def get_linear_decay_fn ( decay_steps ) : # pylint:disable=missing-docstring def linear_decay_fn ( global_step ) : if global_step is None : raise ValueError ( "global_step is required for linear_decay." ) global_step = math_ops . minimum ( global_step , decay_steps ) remaining_steps = math_ops . cast ( decay_steps , dtypes . int32 ) - math_ops . cast ( global_step , dtypes . int32 ) decayed = ( math_ops . cast ( remaining_steps , dtypes . float32 ) / math_ops . cast ( decay_steps , dtypes . float32 ) ) return math_ops . maximum ( 0.0 , decayed ) # pylint:enable=missing-docstring return linear_decay_fn