code: def stop_gradient(input_layer):
    
    if input_layer.is_sequence():
      result = [tf.stop_gradient(t) for t in input_layer.sequence]
      return input_layer.with_sequence(result)
    else:
      return tf.stop_gradient(input_layer)
docs: Cuts off the gradient at this point.
  
    This works on both sequence and regular Pretty Tensors.
  
    Args:
      input_layer: The input.
    Returns:
      A new Pretty Tensor of the same type with stop_gradient applied.