def METHOD_NAME(tensor, tensor_quantizer, per_channel):
    """
    Minmax initialization.
    """
    tensor = torch.abs(tensor)
    if per_channel:
        channel = tensor_quantizer.channel_axis
        for c in reversed(range(len(tensor.shape))):
            if c != channel:
                tensor = tensor.max(c)[0]
        tensor_quantizer.fp8_maxval = tensor.clone().to(tensor.device)
        maxval = tensor
    else:
        maxval = max(torch.abs(tensor.min()), tensor.max()).to(tensor.device)
    return maxval