def _compute_numpy_l2_difference(model, previous_model):
    squared_norms = tf.nest.map_structure((lambda x, y: (tf.linalg.norm((x - y)) ** 2)), model, previous_model)
    l2_total_tensor = (tf.reduce_sum(tf.nest.flatten(squared_norms)) ** 0.5)
    return l2_total_tensor.numpy()
def _compute_numpy_l2_difference(model, previous_model):
    squared_norms = tf.nest.map_structure((lambda x, y: (tf.linalg.norm((x - y)) ** 2)), model, previous_model)
    l2_total_tensor = (tf.reduce_sum(tf.nest.flatten(squared_norms)) ** 0.5)
    return l2_total_tensor.numpy()