This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from typing import Union | |
| import torch | |
| import numpy as np | |
| def percentile(t: torch.tensor, q: float) -> Union[int, float]: | |
| """ | |
| Return the ``q``-th percentile of the flattened input tensor's data. | |
NewerOlder