# Path: torchdiffeq/_impl/event_handling.py
# def combine_event_functions(event_fn, t0, y0):
#     """
#     We ensure all event functions are initially positive,
#     so then we can combine them by taking a min.
#     """
#     with torch.no_grad():
#         initial_signs = torch.sign(event_fn(t0, y0))
# 
#     def combined_event_fn(t, y):
#         c = event_fn(t, y)
#         return torch.min(c * initial_signs)
# 
#     return combined_event_fn


from enum import Enum
from .event_handling import combine_event_functions
import math
import numpy as np
import torch
import warnings


def _handle_unused_kwargs(solver, unused_kwargs):
    if len(unused_kwargs) > 0:
        warnings.warn('{}: Unexpected arguments {}'.format(solver.__class__.__name__, unused_kwargs))


def _linf_norm(tensor):
    return tensor.max()


def _rms_norm(tensor):

# Path: torchdiffeq/_impl/event_handling.py
# def combine_event_functions(event_fn, t0, y0):
#     """
#     We ensure all event functions are initially positive,
#     so then we can combine them by taking a min.
#     """
#     with torch.no_grad():
#         initial_signs = torch.sign(event_fn(t0, y0))
# 
#     def combined_event_fn(t, y):
#         c = event_fn(t, y)
#         return torch.min(c * initial_signs)
# 
#     return combined_event_fn


# Path: torchdiffeq/_impl/misc.py
from enum import Enum
from .event_handling import combine_event_functions
import math
import numpy as np
import torch
import warnings



def _handle_unused_kwargs(solver, unused_kwargs):
    if len(unused_kwargs) > 0:
        warnings.warn('{}: Unexpected arguments {}'.format(solver.__class__.__name__, unused_kwargs))


def _linf_norm(tensor):
    return tensor.max()


def _rms_norm(tensor):

    return tensor.pow(2).mean().sqrt()