Add files using upload-large-folder tool
Browse files- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/__init__.py +22 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/_private/utils.pyi +402 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/setup.py +21 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/tests/__init__.py +0 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/tests/test_utils.py +1626 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/logs/infer_lr3e3_170k_logitnorm_aggressive_20260612/gpu0.log +372 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_011000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_035000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_048000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_055000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_076000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_105000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_128000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_226000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_227000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_256000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_265000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_275000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_291000.pt +3 -0
- LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_300000.pt +3 -0
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/__init__.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Common test support for all numpy test scripts.
|
| 2 |
+
|
| 3 |
+
This single module should provide all the common functionality for numpy tests
|
| 4 |
+
in a single location, so that test scripts can just import it and work right
|
| 5 |
+
away.
|
| 6 |
+
|
| 7 |
+
"""
|
| 8 |
+
from unittest import TestCase
|
| 9 |
+
|
| 10 |
+
from . import _private
|
| 11 |
+
from ._private.utils import *
|
| 12 |
+
from ._private.utils import (_assert_valid_refcount, _gen_alignment_data)
|
| 13 |
+
from ._private import extbuild
|
| 14 |
+
from . import overrides
|
| 15 |
+
|
| 16 |
+
__all__ = (
|
| 17 |
+
_private.utils.__all__ + ['TestCase', 'overrides']
|
| 18 |
+
)
|
| 19 |
+
|
| 20 |
+
from numpy._pytesttester import PytestTester
|
| 21 |
+
test = PytestTester(__name__)
|
| 22 |
+
del PytestTester
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/_private/utils.pyi
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import sys
|
| 3 |
+
import ast
|
| 4 |
+
import types
|
| 5 |
+
import warnings
|
| 6 |
+
import unittest
|
| 7 |
+
import contextlib
|
| 8 |
+
from re import Pattern
|
| 9 |
+
from collections.abc import Callable, Iterable, Sequence
|
| 10 |
+
from typing import (
|
| 11 |
+
Literal as L,
|
| 12 |
+
Any,
|
| 13 |
+
AnyStr,
|
| 14 |
+
ClassVar,
|
| 15 |
+
NoReturn,
|
| 16 |
+
overload,
|
| 17 |
+
type_check_only,
|
| 18 |
+
TypeVar,
|
| 19 |
+
Union,
|
| 20 |
+
Final,
|
| 21 |
+
SupportsIndex,
|
| 22 |
+
)
|
| 23 |
+
if sys.version_info >= (3, 10):
|
| 24 |
+
from typing import ParamSpec
|
| 25 |
+
else:
|
| 26 |
+
from typing_extensions import ParamSpec
|
| 27 |
+
|
| 28 |
+
from numpy import generic, dtype, number, object_, bool_, _FloatValue
|
| 29 |
+
from numpy._typing import (
|
| 30 |
+
NDArray,
|
| 31 |
+
ArrayLike,
|
| 32 |
+
DTypeLike,
|
| 33 |
+
_ArrayLikeNumber_co,
|
| 34 |
+
_ArrayLikeObject_co,
|
| 35 |
+
_ArrayLikeTD64_co,
|
| 36 |
+
_ArrayLikeDT64_co,
|
| 37 |
+
)
|
| 38 |
+
|
| 39 |
+
from unittest.case import (
|
| 40 |
+
SkipTest as SkipTest,
|
| 41 |
+
)
|
| 42 |
+
|
| 43 |
+
_P = ParamSpec("_P")
|
| 44 |
+
_T = TypeVar("_T")
|
| 45 |
+
_ET = TypeVar("_ET", bound=BaseException)
|
| 46 |
+
_FT = TypeVar("_FT", bound=Callable[..., Any])
|
| 47 |
+
|
| 48 |
+
# Must return a bool or an ndarray/generic type
|
| 49 |
+
# that is supported by `np.logical_and.reduce`
|
| 50 |
+
_ComparisonFunc = Callable[
|
| 51 |
+
[NDArray[Any], NDArray[Any]],
|
| 52 |
+
Union[
|
| 53 |
+
bool,
|
| 54 |
+
bool_,
|
| 55 |
+
number[Any],
|
| 56 |
+
NDArray[Union[bool_, number[Any], object_]],
|
| 57 |
+
],
|
| 58 |
+
]
|
| 59 |
+
|
| 60 |
+
__all__: list[str]
|
| 61 |
+
|
| 62 |
+
class KnownFailureException(Exception): ...
|
| 63 |
+
class IgnoreException(Exception): ...
|
| 64 |
+
|
| 65 |
+
class clear_and_catch_warnings(warnings.catch_warnings):
|
| 66 |
+
class_modules: ClassVar[tuple[types.ModuleType, ...]]
|
| 67 |
+
modules: set[types.ModuleType]
|
| 68 |
+
@overload
|
| 69 |
+
def __new__(
|
| 70 |
+
cls,
|
| 71 |
+
record: L[False] = ...,
|
| 72 |
+
modules: Iterable[types.ModuleType] = ...,
|
| 73 |
+
) -> _clear_and_catch_warnings_without_records: ...
|
| 74 |
+
@overload
|
| 75 |
+
def __new__(
|
| 76 |
+
cls,
|
| 77 |
+
record: L[True],
|
| 78 |
+
modules: Iterable[types.ModuleType] = ...,
|
| 79 |
+
) -> _clear_and_catch_warnings_with_records: ...
|
| 80 |
+
@overload
|
| 81 |
+
def __new__(
|
| 82 |
+
cls,
|
| 83 |
+
record: bool,
|
| 84 |
+
modules: Iterable[types.ModuleType] = ...,
|
| 85 |
+
) -> clear_and_catch_warnings: ...
|
| 86 |
+
def __enter__(self) -> None | list[warnings.WarningMessage]: ...
|
| 87 |
+
def __exit__(
|
| 88 |
+
self,
|
| 89 |
+
__exc_type: None | type[BaseException] = ...,
|
| 90 |
+
__exc_val: None | BaseException = ...,
|
| 91 |
+
__exc_tb: None | types.TracebackType = ...,
|
| 92 |
+
) -> None: ...
|
| 93 |
+
|
| 94 |
+
# Type-check only `clear_and_catch_warnings` subclasses for both values of the
|
| 95 |
+
# `record` parameter. Copied from the stdlib `warnings` stubs.
|
| 96 |
+
|
| 97 |
+
@type_check_only
|
| 98 |
+
class _clear_and_catch_warnings_with_records(clear_and_catch_warnings):
|
| 99 |
+
def __enter__(self) -> list[warnings.WarningMessage]: ...
|
| 100 |
+
|
| 101 |
+
@type_check_only
|
| 102 |
+
class _clear_and_catch_warnings_without_records(clear_and_catch_warnings):
|
| 103 |
+
def __enter__(self) -> None: ...
|
| 104 |
+
|
| 105 |
+
class suppress_warnings:
|
| 106 |
+
log: list[warnings.WarningMessage]
|
| 107 |
+
def __init__(
|
| 108 |
+
self,
|
| 109 |
+
forwarding_rule: L["always", "module", "once", "location"] = ...,
|
| 110 |
+
) -> None: ...
|
| 111 |
+
def filter(
|
| 112 |
+
self,
|
| 113 |
+
category: type[Warning] = ...,
|
| 114 |
+
message: str = ...,
|
| 115 |
+
module: None | types.ModuleType = ...,
|
| 116 |
+
) -> None: ...
|
| 117 |
+
def record(
|
| 118 |
+
self,
|
| 119 |
+
category: type[Warning] = ...,
|
| 120 |
+
message: str = ...,
|
| 121 |
+
module: None | types.ModuleType = ...,
|
| 122 |
+
) -> list[warnings.WarningMessage]: ...
|
| 123 |
+
def __enter__(self: _T) -> _T: ...
|
| 124 |
+
def __exit__(
|
| 125 |
+
self,
|
| 126 |
+
__exc_type: None | type[BaseException] = ...,
|
| 127 |
+
__exc_val: None | BaseException = ...,
|
| 128 |
+
__exc_tb: None | types.TracebackType = ...,
|
| 129 |
+
) -> None: ...
|
| 130 |
+
def __call__(self, func: _FT) -> _FT: ...
|
| 131 |
+
|
| 132 |
+
verbose: int
|
| 133 |
+
IS_PYPY: Final[bool]
|
| 134 |
+
IS_PYSTON: Final[bool]
|
| 135 |
+
HAS_REFCOUNT: Final[bool]
|
| 136 |
+
HAS_LAPACK64: Final[bool]
|
| 137 |
+
|
| 138 |
+
def assert_(val: object, msg: str | Callable[[], str] = ...) -> None: ...
|
| 139 |
+
|
| 140 |
+
# Contrary to runtime we can't do `os.name` checks while type checking,
|
| 141 |
+
# only `sys.platform` checks
|
| 142 |
+
if sys.platform == "win32" or sys.platform == "cygwin":
|
| 143 |
+
def memusage(processName: str = ..., instance: int = ...) -> int: ...
|
| 144 |
+
elif sys.platform == "linux":
|
| 145 |
+
def memusage(_proc_pid_stat: str | bytes | os.PathLike[Any] = ...) -> None | int: ...
|
| 146 |
+
else:
|
| 147 |
+
def memusage() -> NoReturn: ...
|
| 148 |
+
|
| 149 |
+
if sys.platform == "linux":
|
| 150 |
+
def jiffies(
|
| 151 |
+
_proc_pid_stat: str | bytes | os.PathLike[Any] = ...,
|
| 152 |
+
_load_time: list[float] = ...,
|
| 153 |
+
) -> int: ...
|
| 154 |
+
else:
|
| 155 |
+
def jiffies(_load_time: list[float] = ...) -> int: ...
|
| 156 |
+
|
| 157 |
+
def build_err_msg(
|
| 158 |
+
arrays: Iterable[object],
|
| 159 |
+
err_msg: str,
|
| 160 |
+
header: str = ...,
|
| 161 |
+
verbose: bool = ...,
|
| 162 |
+
names: Sequence[str] = ...,
|
| 163 |
+
precision: None | SupportsIndex = ...,
|
| 164 |
+
) -> str: ...
|
| 165 |
+
|
| 166 |
+
def assert_equal(
|
| 167 |
+
actual: object,
|
| 168 |
+
desired: object,
|
| 169 |
+
err_msg: str = ...,
|
| 170 |
+
verbose: bool = ...,
|
| 171 |
+
) -> None: ...
|
| 172 |
+
|
| 173 |
+
def print_assert_equal(
|
| 174 |
+
test_string: str,
|
| 175 |
+
actual: object,
|
| 176 |
+
desired: object,
|
| 177 |
+
) -> None: ...
|
| 178 |
+
|
| 179 |
+
def assert_almost_equal(
|
| 180 |
+
actual: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 181 |
+
desired: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 182 |
+
decimal: int = ...,
|
| 183 |
+
err_msg: str = ...,
|
| 184 |
+
verbose: bool = ...,
|
| 185 |
+
) -> None: ...
|
| 186 |
+
|
| 187 |
+
# Anything that can be coerced into `builtins.float`
|
| 188 |
+
def assert_approx_equal(
|
| 189 |
+
actual: _FloatValue,
|
| 190 |
+
desired: _FloatValue,
|
| 191 |
+
significant: int = ...,
|
| 192 |
+
err_msg: str = ...,
|
| 193 |
+
verbose: bool = ...,
|
| 194 |
+
) -> None: ...
|
| 195 |
+
|
| 196 |
+
def assert_array_compare(
|
| 197 |
+
comparison: _ComparisonFunc,
|
| 198 |
+
x: ArrayLike,
|
| 199 |
+
y: ArrayLike,
|
| 200 |
+
err_msg: str = ...,
|
| 201 |
+
verbose: bool = ...,
|
| 202 |
+
header: str = ...,
|
| 203 |
+
precision: SupportsIndex = ...,
|
| 204 |
+
equal_nan: bool = ...,
|
| 205 |
+
equal_inf: bool = ...,
|
| 206 |
+
*,
|
| 207 |
+
strict: bool = ...
|
| 208 |
+
) -> None: ...
|
| 209 |
+
|
| 210 |
+
def assert_array_equal(
|
| 211 |
+
x: ArrayLike,
|
| 212 |
+
y: ArrayLike,
|
| 213 |
+
err_msg: str = ...,
|
| 214 |
+
verbose: bool = ...,
|
| 215 |
+
*,
|
| 216 |
+
strict: bool = ...
|
| 217 |
+
) -> None: ...
|
| 218 |
+
|
| 219 |
+
def assert_array_almost_equal(
|
| 220 |
+
x: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 221 |
+
y: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 222 |
+
decimal: float = ...,
|
| 223 |
+
err_msg: str = ...,
|
| 224 |
+
verbose: bool = ...,
|
| 225 |
+
) -> None: ...
|
| 226 |
+
|
| 227 |
+
@overload
|
| 228 |
+
def assert_array_less(
|
| 229 |
+
x: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 230 |
+
y: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 231 |
+
err_msg: str = ...,
|
| 232 |
+
verbose: bool = ...,
|
| 233 |
+
) -> None: ...
|
| 234 |
+
@overload
|
| 235 |
+
def assert_array_less(
|
| 236 |
+
x: _ArrayLikeTD64_co,
|
| 237 |
+
y: _ArrayLikeTD64_co,
|
| 238 |
+
err_msg: str = ...,
|
| 239 |
+
verbose: bool = ...,
|
| 240 |
+
) -> None: ...
|
| 241 |
+
@overload
|
| 242 |
+
def assert_array_less(
|
| 243 |
+
x: _ArrayLikeDT64_co,
|
| 244 |
+
y: _ArrayLikeDT64_co,
|
| 245 |
+
err_msg: str = ...,
|
| 246 |
+
verbose: bool = ...,
|
| 247 |
+
) -> None: ...
|
| 248 |
+
|
| 249 |
+
def runstring(
|
| 250 |
+
astr: str | bytes | types.CodeType,
|
| 251 |
+
dict: None | dict[str, Any],
|
| 252 |
+
) -> Any: ...
|
| 253 |
+
|
| 254 |
+
def assert_string_equal(actual: str, desired: str) -> None: ...
|
| 255 |
+
|
| 256 |
+
def rundocs(
|
| 257 |
+
filename: None | str | os.PathLike[str] = ...,
|
| 258 |
+
raise_on_error: bool = ...,
|
| 259 |
+
) -> None: ...
|
| 260 |
+
|
| 261 |
+
def raises(*args: type[BaseException]) -> Callable[[_FT], _FT]: ...
|
| 262 |
+
|
| 263 |
+
@overload
|
| 264 |
+
def assert_raises( # type: ignore
|
| 265 |
+
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
|
| 266 |
+
callable: Callable[_P, Any],
|
| 267 |
+
/,
|
| 268 |
+
*args: _P.args,
|
| 269 |
+
**kwargs: _P.kwargs,
|
| 270 |
+
) -> None: ...
|
| 271 |
+
@overload
|
| 272 |
+
def assert_raises(
|
| 273 |
+
expected_exception: type[_ET] | tuple[type[_ET], ...],
|
| 274 |
+
*,
|
| 275 |
+
msg: None | str = ...,
|
| 276 |
+
) -> unittest.case._AssertRaisesContext[_ET]: ...
|
| 277 |
+
|
| 278 |
+
@overload
|
| 279 |
+
def assert_raises_regex(
|
| 280 |
+
expected_exception: type[BaseException] | tuple[type[BaseException], ...],
|
| 281 |
+
expected_regex: str | bytes | Pattern[Any],
|
| 282 |
+
callable: Callable[_P, Any],
|
| 283 |
+
/,
|
| 284 |
+
*args: _P.args,
|
| 285 |
+
**kwargs: _P.kwargs,
|
| 286 |
+
) -> None: ...
|
| 287 |
+
@overload
|
| 288 |
+
def assert_raises_regex(
|
| 289 |
+
expected_exception: type[_ET] | tuple[type[_ET], ...],
|
| 290 |
+
expected_regex: str | bytes | Pattern[Any],
|
| 291 |
+
*,
|
| 292 |
+
msg: None | str = ...,
|
| 293 |
+
) -> unittest.case._AssertRaisesContext[_ET]: ...
|
| 294 |
+
|
| 295 |
+
def decorate_methods(
|
| 296 |
+
cls: type[Any],
|
| 297 |
+
decorator: Callable[[Callable[..., Any]], Any],
|
| 298 |
+
testmatch: None | str | bytes | Pattern[Any] = ...,
|
| 299 |
+
) -> None: ...
|
| 300 |
+
|
| 301 |
+
def measure(
|
| 302 |
+
code_str: str | bytes | ast.mod | ast.AST,
|
| 303 |
+
times: int = ...,
|
| 304 |
+
label: None | str = ...,
|
| 305 |
+
) -> float: ...
|
| 306 |
+
|
| 307 |
+
@overload
|
| 308 |
+
def assert_allclose(
|
| 309 |
+
actual: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 310 |
+
desired: _ArrayLikeNumber_co | _ArrayLikeObject_co,
|
| 311 |
+
rtol: float = ...,
|
| 312 |
+
atol: float = ...,
|
| 313 |
+
equal_nan: bool = ...,
|
| 314 |
+
err_msg: str = ...,
|
| 315 |
+
verbose: bool = ...,
|
| 316 |
+
) -> None: ...
|
| 317 |
+
@overload
|
| 318 |
+
def assert_allclose(
|
| 319 |
+
actual: _ArrayLikeTD64_co,
|
| 320 |
+
desired: _ArrayLikeTD64_co,
|
| 321 |
+
rtol: float = ...,
|
| 322 |
+
atol: float = ...,
|
| 323 |
+
equal_nan: bool = ...,
|
| 324 |
+
err_msg: str = ...,
|
| 325 |
+
verbose: bool = ...,
|
| 326 |
+
) -> None: ...
|
| 327 |
+
|
| 328 |
+
def assert_array_almost_equal_nulp(
|
| 329 |
+
x: _ArrayLikeNumber_co,
|
| 330 |
+
y: _ArrayLikeNumber_co,
|
| 331 |
+
nulp: float = ...,
|
| 332 |
+
) -> None: ...
|
| 333 |
+
|
| 334 |
+
def assert_array_max_ulp(
|
| 335 |
+
a: _ArrayLikeNumber_co,
|
| 336 |
+
b: _ArrayLikeNumber_co,
|
| 337 |
+
maxulp: float = ...,
|
| 338 |
+
dtype: DTypeLike = ...,
|
| 339 |
+
) -> NDArray[Any]: ...
|
| 340 |
+
|
| 341 |
+
@overload
|
| 342 |
+
def assert_warns(
|
| 343 |
+
warning_class: type[Warning],
|
| 344 |
+
) -> contextlib._GeneratorContextManager[None]: ...
|
| 345 |
+
@overload
|
| 346 |
+
def assert_warns(
|
| 347 |
+
warning_class: type[Warning],
|
| 348 |
+
func: Callable[_P, _T],
|
| 349 |
+
/,
|
| 350 |
+
*args: _P.args,
|
| 351 |
+
**kwargs: _P.kwargs,
|
| 352 |
+
) -> _T: ...
|
| 353 |
+
|
| 354 |
+
@overload
|
| 355 |
+
def assert_no_warnings() -> contextlib._GeneratorContextManager[None]: ...
|
| 356 |
+
@overload
|
| 357 |
+
def assert_no_warnings(
|
| 358 |
+
func: Callable[_P, _T],
|
| 359 |
+
/,
|
| 360 |
+
*args: _P.args,
|
| 361 |
+
**kwargs: _P.kwargs,
|
| 362 |
+
) -> _T: ...
|
| 363 |
+
|
| 364 |
+
@overload
|
| 365 |
+
def tempdir(
|
| 366 |
+
suffix: None = ...,
|
| 367 |
+
prefix: None = ...,
|
| 368 |
+
dir: None = ...,
|
| 369 |
+
) -> contextlib._GeneratorContextManager[str]: ...
|
| 370 |
+
@overload
|
| 371 |
+
def tempdir(
|
| 372 |
+
suffix: None | AnyStr = ...,
|
| 373 |
+
prefix: None | AnyStr = ...,
|
| 374 |
+
dir: None | AnyStr | os.PathLike[AnyStr] = ...,
|
| 375 |
+
) -> contextlib._GeneratorContextManager[AnyStr]: ...
|
| 376 |
+
|
| 377 |
+
@overload
|
| 378 |
+
def temppath(
|
| 379 |
+
suffix: None = ...,
|
| 380 |
+
prefix: None = ...,
|
| 381 |
+
dir: None = ...,
|
| 382 |
+
text: bool = ...,
|
| 383 |
+
) -> contextlib._GeneratorContextManager[str]: ...
|
| 384 |
+
@overload
|
| 385 |
+
def temppath(
|
| 386 |
+
suffix: None | AnyStr = ...,
|
| 387 |
+
prefix: None | AnyStr = ...,
|
| 388 |
+
dir: None | AnyStr | os.PathLike[AnyStr] = ...,
|
| 389 |
+
text: bool = ...,
|
| 390 |
+
) -> contextlib._GeneratorContextManager[AnyStr]: ...
|
| 391 |
+
|
| 392 |
+
@overload
|
| 393 |
+
def assert_no_gc_cycles() -> contextlib._GeneratorContextManager[None]: ...
|
| 394 |
+
@overload
|
| 395 |
+
def assert_no_gc_cycles(
|
| 396 |
+
func: Callable[_P, Any],
|
| 397 |
+
/,
|
| 398 |
+
*args: _P.args,
|
| 399 |
+
**kwargs: _P.kwargs,
|
| 400 |
+
) -> None: ...
|
| 401 |
+
|
| 402 |
+
def break_cycles() -> None: ...
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/setup.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
|
| 3 |
+
def configuration(parent_package='',top_path=None):
|
| 4 |
+
from numpy.distutils.misc_util import Configuration
|
| 5 |
+
config = Configuration('testing', parent_package, top_path)
|
| 6 |
+
|
| 7 |
+
config.add_subpackage('_private')
|
| 8 |
+
config.add_subpackage('tests')
|
| 9 |
+
config.add_data_files('*.pyi')
|
| 10 |
+
config.add_data_files('_private/*.pyi')
|
| 11 |
+
return config
|
| 12 |
+
|
| 13 |
+
if __name__ == '__main__':
|
| 14 |
+
from numpy.distutils.core import setup
|
| 15 |
+
setup(maintainer="NumPy Developers",
|
| 16 |
+
maintainer_email="numpy-dev@numpy.org",
|
| 17 |
+
description="NumPy test module",
|
| 18 |
+
url="https://www.numpy.org",
|
| 19 |
+
license="NumPy License (BSD Style)",
|
| 20 |
+
configuration=configuration,
|
| 21 |
+
)
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/tests/__init__.py
ADDED
|
File without changes
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/.venv_qwen35_uv/lib/python3.12/site-packages/numpy/testing/tests/test_utils.py
ADDED
|
@@ -0,0 +1,1626 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import warnings
|
| 2 |
+
import sys
|
| 3 |
+
import os
|
| 4 |
+
import itertools
|
| 5 |
+
import pytest
|
| 6 |
+
import weakref
|
| 7 |
+
|
| 8 |
+
import numpy as np
|
| 9 |
+
from numpy.testing import (
|
| 10 |
+
assert_equal, assert_array_equal, assert_almost_equal,
|
| 11 |
+
assert_array_almost_equal, assert_array_less, build_err_msg,
|
| 12 |
+
assert_raises, assert_warns, assert_no_warnings, assert_allclose,
|
| 13 |
+
assert_approx_equal, assert_array_almost_equal_nulp, assert_array_max_ulp,
|
| 14 |
+
clear_and_catch_warnings, suppress_warnings, assert_string_equal, assert_,
|
| 15 |
+
tempdir, temppath, assert_no_gc_cycles, HAS_REFCOUNT
|
| 16 |
+
)
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
class _GenericTest:
|
| 20 |
+
|
| 21 |
+
def _test_equal(self, a, b):
|
| 22 |
+
self._assert_func(a, b)
|
| 23 |
+
|
| 24 |
+
def _test_not_equal(self, a, b):
|
| 25 |
+
with assert_raises(AssertionError):
|
| 26 |
+
self._assert_func(a, b)
|
| 27 |
+
|
| 28 |
+
def test_array_rank1_eq(self):
|
| 29 |
+
"""Test two equal array of rank 1 are found equal."""
|
| 30 |
+
a = np.array([1, 2])
|
| 31 |
+
b = np.array([1, 2])
|
| 32 |
+
|
| 33 |
+
self._test_equal(a, b)
|
| 34 |
+
|
| 35 |
+
def test_array_rank1_noteq(self):
|
| 36 |
+
"""Test two different array of rank 1 are found not equal."""
|
| 37 |
+
a = np.array([1, 2])
|
| 38 |
+
b = np.array([2, 2])
|
| 39 |
+
|
| 40 |
+
self._test_not_equal(a, b)
|
| 41 |
+
|
| 42 |
+
def test_array_rank2_eq(self):
|
| 43 |
+
"""Test two equal array of rank 2 are found equal."""
|
| 44 |
+
a = np.array([[1, 2], [3, 4]])
|
| 45 |
+
b = np.array([[1, 2], [3, 4]])
|
| 46 |
+
|
| 47 |
+
self._test_equal(a, b)
|
| 48 |
+
|
| 49 |
+
def test_array_diffshape(self):
|
| 50 |
+
"""Test two arrays with different shapes are found not equal."""
|
| 51 |
+
a = np.array([1, 2])
|
| 52 |
+
b = np.array([[1, 2], [1, 2]])
|
| 53 |
+
|
| 54 |
+
self._test_not_equal(a, b)
|
| 55 |
+
|
| 56 |
+
def test_objarray(self):
|
| 57 |
+
"""Test object arrays."""
|
| 58 |
+
a = np.array([1, 1], dtype=object)
|
| 59 |
+
self._test_equal(a, 1)
|
| 60 |
+
|
| 61 |
+
def test_array_likes(self):
|
| 62 |
+
self._test_equal([1, 2, 3], (1, 2, 3))
|
| 63 |
+
|
| 64 |
+
|
| 65 |
+
class TestArrayEqual(_GenericTest):
|
| 66 |
+
|
| 67 |
+
def setup_method(self):
|
| 68 |
+
self._assert_func = assert_array_equal
|
| 69 |
+
|
| 70 |
+
def test_generic_rank1(self):
|
| 71 |
+
"""Test rank 1 array for all dtypes."""
|
| 72 |
+
def foo(t):
|
| 73 |
+
a = np.empty(2, t)
|
| 74 |
+
a.fill(1)
|
| 75 |
+
b = a.copy()
|
| 76 |
+
c = a.copy()
|
| 77 |
+
c.fill(0)
|
| 78 |
+
self._test_equal(a, b)
|
| 79 |
+
self._test_not_equal(c, b)
|
| 80 |
+
|
| 81 |
+
# Test numeric types and object
|
| 82 |
+
for t in '?bhilqpBHILQPfdgFDG':
|
| 83 |
+
foo(t)
|
| 84 |
+
|
| 85 |
+
# Test strings
|
| 86 |
+
for t in ['S1', 'U1']:
|
| 87 |
+
foo(t)
|
| 88 |
+
|
| 89 |
+
def test_0_ndim_array(self):
|
| 90 |
+
x = np.array(473963742225900817127911193656584771)
|
| 91 |
+
y = np.array(18535119325151578301457182298393896)
|
| 92 |
+
assert_raises(AssertionError, self._assert_func, x, y)
|
| 93 |
+
|
| 94 |
+
y = x
|
| 95 |
+
self._assert_func(x, y)
|
| 96 |
+
|
| 97 |
+
x = np.array(43)
|
| 98 |
+
y = np.array(10)
|
| 99 |
+
assert_raises(AssertionError, self._assert_func, x, y)
|
| 100 |
+
|
| 101 |
+
y = x
|
| 102 |
+
self._assert_func(x, y)
|
| 103 |
+
|
| 104 |
+
def test_generic_rank3(self):
|
| 105 |
+
"""Test rank 3 array for all dtypes."""
|
| 106 |
+
def foo(t):
|
| 107 |
+
a = np.empty((4, 2, 3), t)
|
| 108 |
+
a.fill(1)
|
| 109 |
+
b = a.copy()
|
| 110 |
+
c = a.copy()
|
| 111 |
+
c.fill(0)
|
| 112 |
+
self._test_equal(a, b)
|
| 113 |
+
self._test_not_equal(c, b)
|
| 114 |
+
|
| 115 |
+
# Test numeric types and object
|
| 116 |
+
for t in '?bhilqpBHILQPfdgFDG':
|
| 117 |
+
foo(t)
|
| 118 |
+
|
| 119 |
+
# Test strings
|
| 120 |
+
for t in ['S1', 'U1']:
|
| 121 |
+
foo(t)
|
| 122 |
+
|
| 123 |
+
def test_nan_array(self):
|
| 124 |
+
"""Test arrays with nan values in them."""
|
| 125 |
+
a = np.array([1, 2, np.nan])
|
| 126 |
+
b = np.array([1, 2, np.nan])
|
| 127 |
+
|
| 128 |
+
self._test_equal(a, b)
|
| 129 |
+
|
| 130 |
+
c = np.array([1, 2, 3])
|
| 131 |
+
self._test_not_equal(c, b)
|
| 132 |
+
|
| 133 |
+
def test_string_arrays(self):
|
| 134 |
+
"""Test two arrays with different shapes are found not equal."""
|
| 135 |
+
a = np.array(['floupi', 'floupa'])
|
| 136 |
+
b = np.array(['floupi', 'floupa'])
|
| 137 |
+
|
| 138 |
+
self._test_equal(a, b)
|
| 139 |
+
|
| 140 |
+
c = np.array(['floupipi', 'floupa'])
|
| 141 |
+
|
| 142 |
+
self._test_not_equal(c, b)
|
| 143 |
+
|
| 144 |
+
def test_recarrays(self):
|
| 145 |
+
"""Test record arrays."""
|
| 146 |
+
a = np.empty(2, [('floupi', float), ('floupa', float)])
|
| 147 |
+
a['floupi'] = [1, 2]
|
| 148 |
+
a['floupa'] = [1, 2]
|
| 149 |
+
b = a.copy()
|
| 150 |
+
|
| 151 |
+
self._test_equal(a, b)
|
| 152 |
+
|
| 153 |
+
c = np.empty(2, [('floupipi', float),
|
| 154 |
+
('floupi', float), ('floupa', float)])
|
| 155 |
+
c['floupipi'] = a['floupi'].copy()
|
| 156 |
+
c['floupa'] = a['floupa'].copy()
|
| 157 |
+
|
| 158 |
+
with pytest.raises(TypeError):
|
| 159 |
+
self._test_not_equal(c, b)
|
| 160 |
+
|
| 161 |
+
def test_masked_nan_inf(self):
|
| 162 |
+
# Regression test for gh-11121
|
| 163 |
+
a = np.ma.MaskedArray([3., 4., 6.5], mask=[False, True, False])
|
| 164 |
+
b = np.array([3., np.nan, 6.5])
|
| 165 |
+
self._test_equal(a, b)
|
| 166 |
+
self._test_equal(b, a)
|
| 167 |
+
a = np.ma.MaskedArray([3., 4., 6.5], mask=[True, False, False])
|
| 168 |
+
b = np.array([np.inf, 4., 6.5])
|
| 169 |
+
self._test_equal(a, b)
|
| 170 |
+
self._test_equal(b, a)
|
| 171 |
+
|
| 172 |
+
def test_subclass_that_overrides_eq(self):
|
| 173 |
+
# While we cannot guarantee testing functions will always work for
|
| 174 |
+
# subclasses, the tests should ideally rely only on subclasses having
|
| 175 |
+
# comparison operators, not on them being able to store booleans
|
| 176 |
+
# (which, e.g., astropy Quantity cannot usefully do). See gh-8452.
|
| 177 |
+
class MyArray(np.ndarray):
|
| 178 |
+
def __eq__(self, other):
|
| 179 |
+
return bool(np.equal(self, other).all())
|
| 180 |
+
|
| 181 |
+
def __ne__(self, other):
|
| 182 |
+
return not self == other
|
| 183 |
+
|
| 184 |
+
a = np.array([1., 2.]).view(MyArray)
|
| 185 |
+
b = np.array([2., 3.]).view(MyArray)
|
| 186 |
+
assert_(type(a == a), bool)
|
| 187 |
+
assert_(a == a)
|
| 188 |
+
assert_(a != b)
|
| 189 |
+
self._test_equal(a, a)
|
| 190 |
+
self._test_not_equal(a, b)
|
| 191 |
+
self._test_not_equal(b, a)
|
| 192 |
+
|
| 193 |
+
def test_subclass_that_does_not_implement_npall(self):
|
| 194 |
+
class MyArray(np.ndarray):
|
| 195 |
+
def __array_function__(self, *args, **kwargs):
|
| 196 |
+
return NotImplemented
|
| 197 |
+
|
| 198 |
+
a = np.array([1., 2.]).view(MyArray)
|
| 199 |
+
b = np.array([2., 3.]).view(MyArray)
|
| 200 |
+
with assert_raises(TypeError):
|
| 201 |
+
np.all(a)
|
| 202 |
+
self._test_equal(a, a)
|
| 203 |
+
self._test_not_equal(a, b)
|
| 204 |
+
self._test_not_equal(b, a)
|
| 205 |
+
|
| 206 |
+
def test_suppress_overflow_warnings(self):
|
| 207 |
+
# Based on issue #18992
|
| 208 |
+
with pytest.raises(AssertionError):
|
| 209 |
+
with np.errstate(all="raise"):
|
| 210 |
+
np.testing.assert_array_equal(
|
| 211 |
+
np.array([1, 2, 3], np.float32),
|
| 212 |
+
np.array([1, 1e-40, 3], np.float32))
|
| 213 |
+
|
| 214 |
+
def test_array_vs_scalar_is_equal(self):
|
| 215 |
+
"""Test comparing an array with a scalar when all values are equal."""
|
| 216 |
+
a = np.array([1., 1., 1.])
|
| 217 |
+
b = 1.
|
| 218 |
+
|
| 219 |
+
self._test_equal(a, b)
|
| 220 |
+
|
| 221 |
+
def test_array_vs_scalar_not_equal(self):
|
| 222 |
+
"""Test comparing an array with a scalar when not all values equal."""
|
| 223 |
+
a = np.array([1., 2., 3.])
|
| 224 |
+
b = 1.
|
| 225 |
+
|
| 226 |
+
self._test_not_equal(a, b)
|
| 227 |
+
|
| 228 |
+
def test_array_vs_scalar_strict(self):
|
| 229 |
+
"""Test comparing an array with a scalar with strict option."""
|
| 230 |
+
a = np.array([1., 1., 1.])
|
| 231 |
+
b = 1.
|
| 232 |
+
|
| 233 |
+
with pytest.raises(AssertionError):
|
| 234 |
+
assert_array_equal(a, b, strict=True)
|
| 235 |
+
|
| 236 |
+
def test_array_vs_array_strict(self):
|
| 237 |
+
"""Test comparing two arrays with strict option."""
|
| 238 |
+
a = np.array([1., 1., 1.])
|
| 239 |
+
b = np.array([1., 1., 1.])
|
| 240 |
+
|
| 241 |
+
assert_array_equal(a, b, strict=True)
|
| 242 |
+
|
| 243 |
+
def test_array_vs_float_array_strict(self):
|
| 244 |
+
"""Test comparing two arrays with strict option."""
|
| 245 |
+
a = np.array([1, 1, 1])
|
| 246 |
+
b = np.array([1., 1., 1.])
|
| 247 |
+
|
| 248 |
+
with pytest.raises(AssertionError):
|
| 249 |
+
assert_array_equal(a, b, strict=True)
|
| 250 |
+
|
| 251 |
+
|
| 252 |
+
class TestBuildErrorMessage:
|
| 253 |
+
|
| 254 |
+
def test_build_err_msg_defaults(self):
|
| 255 |
+
x = np.array([1.00001, 2.00002, 3.00003])
|
| 256 |
+
y = np.array([1.00002, 2.00003, 3.00004])
|
| 257 |
+
err_msg = 'There is a mismatch'
|
| 258 |
+
|
| 259 |
+
a = build_err_msg([x, y], err_msg)
|
| 260 |
+
b = ('\nItems are not equal: There is a mismatch\n ACTUAL: array(['
|
| 261 |
+
'1.00001, 2.00002, 3.00003])\n DESIRED: array([1.00002, '
|
| 262 |
+
'2.00003, 3.00004])')
|
| 263 |
+
assert_equal(a, b)
|
| 264 |
+
|
| 265 |
+
def test_build_err_msg_no_verbose(self):
|
| 266 |
+
x = np.array([1.00001, 2.00002, 3.00003])
|
| 267 |
+
y = np.array([1.00002, 2.00003, 3.00004])
|
| 268 |
+
err_msg = 'There is a mismatch'
|
| 269 |
+
|
| 270 |
+
a = build_err_msg([x, y], err_msg, verbose=False)
|
| 271 |
+
b = '\nItems are not equal: There is a mismatch'
|
| 272 |
+
assert_equal(a, b)
|
| 273 |
+
|
| 274 |
+
def test_build_err_msg_custom_names(self):
|
| 275 |
+
x = np.array([1.00001, 2.00002, 3.00003])
|
| 276 |
+
y = np.array([1.00002, 2.00003, 3.00004])
|
| 277 |
+
err_msg = 'There is a mismatch'
|
| 278 |
+
|
| 279 |
+
a = build_err_msg([x, y], err_msg, names=('FOO', 'BAR'))
|
| 280 |
+
b = ('\nItems are not equal: There is a mismatch\n FOO: array(['
|
| 281 |
+
'1.00001, 2.00002, 3.00003])\n BAR: array([1.00002, 2.00003, '
|
| 282 |
+
'3.00004])')
|
| 283 |
+
assert_equal(a, b)
|
| 284 |
+
|
| 285 |
+
def test_build_err_msg_custom_precision(self):
|
| 286 |
+
x = np.array([1.000000001, 2.00002, 3.00003])
|
| 287 |
+
y = np.array([1.000000002, 2.00003, 3.00004])
|
| 288 |
+
err_msg = 'There is a mismatch'
|
| 289 |
+
|
| 290 |
+
a = build_err_msg([x, y], err_msg, precision=10)
|
| 291 |
+
b = ('\nItems are not equal: There is a mismatch\n ACTUAL: array(['
|
| 292 |
+
'1.000000001, 2.00002 , 3.00003 ])\n DESIRED: array(['
|
| 293 |
+
'1.000000002, 2.00003 , 3.00004 ])')
|
| 294 |
+
assert_equal(a, b)
|
| 295 |
+
|
| 296 |
+
|
| 297 |
+
class TestEqual(TestArrayEqual):
|
| 298 |
+
|
| 299 |
+
def setup_method(self):
|
| 300 |
+
self._assert_func = assert_equal
|
| 301 |
+
|
| 302 |
+
def test_nan_items(self):
|
| 303 |
+
self._assert_func(np.nan, np.nan)
|
| 304 |
+
self._assert_func([np.nan], [np.nan])
|
| 305 |
+
self._test_not_equal(np.nan, [np.nan])
|
| 306 |
+
self._test_not_equal(np.nan, 1)
|
| 307 |
+
|
| 308 |
+
def test_inf_items(self):
|
| 309 |
+
self._assert_func(np.inf, np.inf)
|
| 310 |
+
self._assert_func([np.inf], [np.inf])
|
| 311 |
+
self._test_not_equal(np.inf, [np.inf])
|
| 312 |
+
|
| 313 |
+
def test_datetime(self):
|
| 314 |
+
self._test_equal(
|
| 315 |
+
np.datetime64("2017-01-01", "s"),
|
| 316 |
+
np.datetime64("2017-01-01", "s")
|
| 317 |
+
)
|
| 318 |
+
self._test_equal(
|
| 319 |
+
np.datetime64("2017-01-01", "s"),
|
| 320 |
+
np.datetime64("2017-01-01", "m")
|
| 321 |
+
)
|
| 322 |
+
|
| 323 |
+
# gh-10081
|
| 324 |
+
self._test_not_equal(
|
| 325 |
+
np.datetime64("2017-01-01", "s"),
|
| 326 |
+
np.datetime64("2017-01-02", "s")
|
| 327 |
+
)
|
| 328 |
+
self._test_not_equal(
|
| 329 |
+
np.datetime64("2017-01-01", "s"),
|
| 330 |
+
np.datetime64("2017-01-02", "m")
|
| 331 |
+
)
|
| 332 |
+
|
| 333 |
+
def test_nat_items(self):
|
| 334 |
+
# not a datetime
|
| 335 |
+
nadt_no_unit = np.datetime64("NaT")
|
| 336 |
+
nadt_s = np.datetime64("NaT", "s")
|
| 337 |
+
nadt_d = np.datetime64("NaT", "ns")
|
| 338 |
+
# not a timedelta
|
| 339 |
+
natd_no_unit = np.timedelta64("NaT")
|
| 340 |
+
natd_s = np.timedelta64("NaT", "s")
|
| 341 |
+
natd_d = np.timedelta64("NaT", "ns")
|
| 342 |
+
|
| 343 |
+
dts = [nadt_no_unit, nadt_s, nadt_d]
|
| 344 |
+
tds = [natd_no_unit, natd_s, natd_d]
|
| 345 |
+
for a, b in itertools.product(dts, dts):
|
| 346 |
+
self._assert_func(a, b)
|
| 347 |
+
self._assert_func([a], [b])
|
| 348 |
+
self._test_not_equal([a], b)
|
| 349 |
+
|
| 350 |
+
for a, b in itertools.product(tds, tds):
|
| 351 |
+
self._assert_func(a, b)
|
| 352 |
+
self._assert_func([a], [b])
|
| 353 |
+
self._test_not_equal([a], b)
|
| 354 |
+
|
| 355 |
+
for a, b in itertools.product(tds, dts):
|
| 356 |
+
self._test_not_equal(a, b)
|
| 357 |
+
self._test_not_equal(a, [b])
|
| 358 |
+
self._test_not_equal([a], [b])
|
| 359 |
+
self._test_not_equal([a], np.datetime64("2017-01-01", "s"))
|
| 360 |
+
self._test_not_equal([b], np.datetime64("2017-01-01", "s"))
|
| 361 |
+
self._test_not_equal([a], np.timedelta64(123, "s"))
|
| 362 |
+
self._test_not_equal([b], np.timedelta64(123, "s"))
|
| 363 |
+
|
| 364 |
+
def test_non_numeric(self):
|
| 365 |
+
self._assert_func('ab', 'ab')
|
| 366 |
+
self._test_not_equal('ab', 'abb')
|
| 367 |
+
|
| 368 |
+
def test_complex_item(self):
|
| 369 |
+
self._assert_func(complex(1, 2), complex(1, 2))
|
| 370 |
+
self._assert_func(complex(1, np.nan), complex(1, np.nan))
|
| 371 |
+
self._test_not_equal(complex(1, np.nan), complex(1, 2))
|
| 372 |
+
self._test_not_equal(complex(np.nan, 1), complex(1, np.nan))
|
| 373 |
+
self._test_not_equal(complex(np.nan, np.inf), complex(np.nan, 2))
|
| 374 |
+
|
| 375 |
+
def test_negative_zero(self):
|
| 376 |
+
self._test_not_equal(np.PZERO, np.NZERO)
|
| 377 |
+
|
| 378 |
+
def test_complex(self):
|
| 379 |
+
x = np.array([complex(1, 2), complex(1, np.nan)])
|
| 380 |
+
y = np.array([complex(1, 2), complex(1, 2)])
|
| 381 |
+
self._assert_func(x, x)
|
| 382 |
+
self._test_not_equal(x, y)
|
| 383 |
+
|
| 384 |
+
def test_object(self):
|
| 385 |
+
#gh-12942
|
| 386 |
+
import datetime
|
| 387 |
+
a = np.array([datetime.datetime(2000, 1, 1),
|
| 388 |
+
datetime.datetime(2000, 1, 2)])
|
| 389 |
+
self._test_not_equal(a, a[::-1])
|
| 390 |
+
|
| 391 |
+
|
| 392 |
+
class TestArrayAlmostEqual(_GenericTest):
|
| 393 |
+
|
| 394 |
+
def setup_method(self):
|
| 395 |
+
self._assert_func = assert_array_almost_equal
|
| 396 |
+
|
| 397 |
+
def test_closeness(self):
|
| 398 |
+
# Note that in the course of time we ended up with
|
| 399 |
+
# `abs(x - y) < 1.5 * 10**(-decimal)`
|
| 400 |
+
# instead of the previously documented
|
| 401 |
+
# `abs(x - y) < 0.5 * 10**(-decimal)`
|
| 402 |
+
# so this check serves to preserve the wrongness.
|
| 403 |
+
|
| 404 |
+
# test scalars
|
| 405 |
+
self._assert_func(1.499999, 0.0, decimal=0)
|
| 406 |
+
assert_raises(AssertionError,
|
| 407 |
+
lambda: self._assert_func(1.5, 0.0, decimal=0))
|
| 408 |
+
|
| 409 |
+
# test arrays
|
| 410 |
+
self._assert_func([1.499999], [0.0], decimal=0)
|
| 411 |
+
assert_raises(AssertionError,
|
| 412 |
+
lambda: self._assert_func([1.5], [0.0], decimal=0))
|
| 413 |
+
|
| 414 |
+
def test_simple(self):
|
| 415 |
+
x = np.array([1234.2222])
|
| 416 |
+
y = np.array([1234.2223])
|
| 417 |
+
|
| 418 |
+
self._assert_func(x, y, decimal=3)
|
| 419 |
+
self._assert_func(x, y, decimal=4)
|
| 420 |
+
assert_raises(AssertionError,
|
| 421 |
+
lambda: self._assert_func(x, y, decimal=5))
|
| 422 |
+
|
| 423 |
+
def test_nan(self):
|
| 424 |
+
anan = np.array([np.nan])
|
| 425 |
+
aone = np.array([1])
|
| 426 |
+
ainf = np.array([np.inf])
|
| 427 |
+
self._assert_func(anan, anan)
|
| 428 |
+
assert_raises(AssertionError,
|
| 429 |
+
lambda: self._assert_func(anan, aone))
|
| 430 |
+
assert_raises(AssertionError,
|
| 431 |
+
lambda: self._assert_func(anan, ainf))
|
| 432 |
+
assert_raises(AssertionError,
|
| 433 |
+
lambda: self._assert_func(ainf, anan))
|
| 434 |
+
|
| 435 |
+
def test_inf(self):
|
| 436 |
+
a = np.array([[1., 2.], [3., 4.]])
|
| 437 |
+
b = a.copy()
|
| 438 |
+
a[0, 0] = np.inf
|
| 439 |
+
assert_raises(AssertionError,
|
| 440 |
+
lambda: self._assert_func(a, b))
|
| 441 |
+
b[0, 0] = -np.inf
|
| 442 |
+
assert_raises(AssertionError,
|
| 443 |
+
lambda: self._assert_func(a, b))
|
| 444 |
+
|
| 445 |
+
def test_subclass(self):
|
| 446 |
+
a = np.array([[1., 2.], [3., 4.]])
|
| 447 |
+
b = np.ma.masked_array([[1., 2.], [0., 4.]],
|
| 448 |
+
[[False, False], [True, False]])
|
| 449 |
+
self._assert_func(a, b)
|
| 450 |
+
self._assert_func(b, a)
|
| 451 |
+
self._assert_func(b, b)
|
| 452 |
+
|
| 453 |
+
# Test fully masked as well (see gh-11123).
|
| 454 |
+
a = np.ma.MaskedArray(3.5, mask=True)
|
| 455 |
+
b = np.array([3., 4., 6.5])
|
| 456 |
+
self._test_equal(a, b)
|
| 457 |
+
self._test_equal(b, a)
|
| 458 |
+
a = np.ma.masked
|
| 459 |
+
b = np.array([3., 4., 6.5])
|
| 460 |
+
self._test_equal(a, b)
|
| 461 |
+
self._test_equal(b, a)
|
| 462 |
+
a = np.ma.MaskedArray([3., 4., 6.5], mask=[True, True, True])
|
| 463 |
+
b = np.array([1., 2., 3.])
|
| 464 |
+
self._test_equal(a, b)
|
| 465 |
+
self._test_equal(b, a)
|
| 466 |
+
a = np.ma.MaskedArray([3., 4., 6.5], mask=[True, True, True])
|
| 467 |
+
b = np.array(1.)
|
| 468 |
+
self._test_equal(a, b)
|
| 469 |
+
self._test_equal(b, a)
|
| 470 |
+
|
| 471 |
+
def test_subclass_that_cannot_be_bool(self):
|
| 472 |
+
# While we cannot guarantee testing functions will always work for
|
| 473 |
+
# subclasses, the tests should ideally rely only on subclasses having
|
| 474 |
+
# comparison operators, not on them being able to store booleans
|
| 475 |
+
# (which, e.g., astropy Quantity cannot usefully do). See gh-8452.
|
| 476 |
+
class MyArray(np.ndarray):
|
| 477 |
+
def __eq__(self, other):
|
| 478 |
+
return super().__eq__(other).view(np.ndarray)
|
| 479 |
+
|
| 480 |
+
def __lt__(self, other):
|
| 481 |
+
return super().__lt__(other).view(np.ndarray)
|
| 482 |
+
|
| 483 |
+
def all(self, *args, **kwargs):
|
| 484 |
+
raise NotImplementedError
|
| 485 |
+
|
| 486 |
+
a = np.array([1., 2.]).view(MyArray)
|
| 487 |
+
self._assert_func(a, a)
|
| 488 |
+
|
| 489 |
+
|
| 490 |
+
class TestAlmostEqual(_GenericTest):
|
| 491 |
+
|
| 492 |
+
def setup_method(self):
|
| 493 |
+
self._assert_func = assert_almost_equal
|
| 494 |
+
|
| 495 |
+
def test_closeness(self):
|
| 496 |
+
# Note that in the course of time we ended up with
|
| 497 |
+
# `abs(x - y) < 1.5 * 10**(-decimal)`
|
| 498 |
+
# instead of the previously documented
|
| 499 |
+
# `abs(x - y) < 0.5 * 10**(-decimal)`
|
| 500 |
+
# so this check serves to preserve the wrongness.
|
| 501 |
+
|
| 502 |
+
# test scalars
|
| 503 |
+
self._assert_func(1.499999, 0.0, decimal=0)
|
| 504 |
+
assert_raises(AssertionError,
|
| 505 |
+
lambda: self._assert_func(1.5, 0.0, decimal=0))
|
| 506 |
+
|
| 507 |
+
# test arrays
|
| 508 |
+
self._assert_func([1.499999], [0.0], decimal=0)
|
| 509 |
+
assert_raises(AssertionError,
|
| 510 |
+
lambda: self._assert_func([1.5], [0.0], decimal=0))
|
| 511 |
+
|
| 512 |
+
def test_nan_item(self):
|
| 513 |
+
self._assert_func(np.nan, np.nan)
|
| 514 |
+
assert_raises(AssertionError,
|
| 515 |
+
lambda: self._assert_func(np.nan, 1))
|
| 516 |
+
assert_raises(AssertionError,
|
| 517 |
+
lambda: self._assert_func(np.nan, np.inf))
|
| 518 |
+
assert_raises(AssertionError,
|
| 519 |
+
lambda: self._assert_func(np.inf, np.nan))
|
| 520 |
+
|
| 521 |
+
def test_inf_item(self):
|
| 522 |
+
self._assert_func(np.inf, np.inf)
|
| 523 |
+
self._assert_func(-np.inf, -np.inf)
|
| 524 |
+
assert_raises(AssertionError,
|
| 525 |
+
lambda: self._assert_func(np.inf, 1))
|
| 526 |
+
assert_raises(AssertionError,
|
| 527 |
+
lambda: self._assert_func(-np.inf, np.inf))
|
| 528 |
+
|
| 529 |
+
def test_simple_item(self):
|
| 530 |
+
self._test_not_equal(1, 2)
|
| 531 |
+
|
| 532 |
+
def test_complex_item(self):
|
| 533 |
+
self._assert_func(complex(1, 2), complex(1, 2))
|
| 534 |
+
self._assert_func(complex(1, np.nan), complex(1, np.nan))
|
| 535 |
+
self._assert_func(complex(np.inf, np.nan), complex(np.inf, np.nan))
|
| 536 |
+
self._test_not_equal(complex(1, np.nan), complex(1, 2))
|
| 537 |
+
self._test_not_equal(complex(np.nan, 1), complex(1, np.nan))
|
| 538 |
+
self._test_not_equal(complex(np.nan, np.inf), complex(np.nan, 2))
|
| 539 |
+
|
| 540 |
+
def test_complex(self):
|
| 541 |
+
x = np.array([complex(1, 2), complex(1, np.nan)])
|
| 542 |
+
z = np.array([complex(1, 2), complex(np.nan, 1)])
|
| 543 |
+
y = np.array([complex(1, 2), complex(1, 2)])
|
| 544 |
+
self._assert_func(x, x)
|
| 545 |
+
self._test_not_equal(x, y)
|
| 546 |
+
self._test_not_equal(x, z)
|
| 547 |
+
|
| 548 |
+
def test_error_message(self):
|
| 549 |
+
"""Check the message is formatted correctly for the decimal value.
|
| 550 |
+
Also check the message when input includes inf or nan (gh12200)"""
|
| 551 |
+
x = np.array([1.00000000001, 2.00000000002, 3.00003])
|
| 552 |
+
y = np.array([1.00000000002, 2.00000000003, 3.00004])
|
| 553 |
+
|
| 554 |
+
# Test with a different amount of decimal digits
|
| 555 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 556 |
+
self._assert_func(x, y, decimal=12)
|
| 557 |
+
msgs = str(exc_info.value).split('\n')
|
| 558 |
+
assert_equal(msgs[3], 'Mismatched elements: 3 / 3 (100%)')
|
| 559 |
+
assert_equal(msgs[4], 'Max absolute difference: 1.e-05')
|
| 560 |
+
assert_equal(msgs[5], 'Max relative difference: 3.33328889e-06')
|
| 561 |
+
assert_equal(
|
| 562 |
+
msgs[6],
|
| 563 |
+
' x: array([1.00000000001, 2.00000000002, 3.00003 ])')
|
| 564 |
+
assert_equal(
|
| 565 |
+
msgs[7],
|
| 566 |
+
' y: array([1.00000000002, 2.00000000003, 3.00004 ])')
|
| 567 |
+
|
| 568 |
+
# With the default value of decimal digits, only the 3rd element
|
| 569 |
+
# differs. Note that we only check for the formatting of the arrays
|
| 570 |
+
# themselves.
|
| 571 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 572 |
+
self._assert_func(x, y)
|
| 573 |
+
msgs = str(exc_info.value).split('\n')
|
| 574 |
+
assert_equal(msgs[3], 'Mismatched elements: 1 / 3 (33.3%)')
|
| 575 |
+
assert_equal(msgs[4], 'Max absolute difference: 1.e-05')
|
| 576 |
+
assert_equal(msgs[5], 'Max relative difference: 3.33328889e-06')
|
| 577 |
+
assert_equal(msgs[6], ' x: array([1. , 2. , 3.00003])')
|
| 578 |
+
assert_equal(msgs[7], ' y: array([1. , 2. , 3.00004])')
|
| 579 |
+
|
| 580 |
+
# Check the error message when input includes inf
|
| 581 |
+
x = np.array([np.inf, 0])
|
| 582 |
+
y = np.array([np.inf, 1])
|
| 583 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 584 |
+
self._assert_func(x, y)
|
| 585 |
+
msgs = str(exc_info.value).split('\n')
|
| 586 |
+
assert_equal(msgs[3], 'Mismatched elements: 1 / 2 (50%)')
|
| 587 |
+
assert_equal(msgs[4], 'Max absolute difference: 1.')
|
| 588 |
+
assert_equal(msgs[5], 'Max relative difference: 1.')
|
| 589 |
+
assert_equal(msgs[6], ' x: array([inf, 0.])')
|
| 590 |
+
assert_equal(msgs[7], ' y: array([inf, 1.])')
|
| 591 |
+
|
| 592 |
+
# Check the error message when dividing by zero
|
| 593 |
+
x = np.array([1, 2])
|
| 594 |
+
y = np.array([0, 0])
|
| 595 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 596 |
+
self._assert_func(x, y)
|
| 597 |
+
msgs = str(exc_info.value).split('\n')
|
| 598 |
+
assert_equal(msgs[3], 'Mismatched elements: 2 / 2 (100%)')
|
| 599 |
+
assert_equal(msgs[4], 'Max absolute difference: 2')
|
| 600 |
+
assert_equal(msgs[5], 'Max relative difference: inf')
|
| 601 |
+
|
| 602 |
+
def test_error_message_2(self):
|
| 603 |
+
"""Check the message is formatted correctly when either x or y is a scalar."""
|
| 604 |
+
x = 2
|
| 605 |
+
y = np.ones(20)
|
| 606 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 607 |
+
self._assert_func(x, y)
|
| 608 |
+
msgs = str(exc_info.value).split('\n')
|
| 609 |
+
assert_equal(msgs[3], 'Mismatched elements: 20 / 20 (100%)')
|
| 610 |
+
assert_equal(msgs[4], 'Max absolute difference: 1.')
|
| 611 |
+
assert_equal(msgs[5], 'Max relative difference: 1.')
|
| 612 |
+
|
| 613 |
+
y = 2
|
| 614 |
+
x = np.ones(20)
|
| 615 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 616 |
+
self._assert_func(x, y)
|
| 617 |
+
msgs = str(exc_info.value).split('\n')
|
| 618 |
+
assert_equal(msgs[3], 'Mismatched elements: 20 / 20 (100%)')
|
| 619 |
+
assert_equal(msgs[4], 'Max absolute difference: 1.')
|
| 620 |
+
assert_equal(msgs[5], 'Max relative difference: 0.5')
|
| 621 |
+
|
| 622 |
+
def test_subclass_that_cannot_be_bool(self):
|
| 623 |
+
# While we cannot guarantee testing functions will always work for
|
| 624 |
+
# subclasses, the tests should ideally rely only on subclasses having
|
| 625 |
+
# comparison operators, not on them being able to store booleans
|
| 626 |
+
# (which, e.g., astropy Quantity cannot usefully do). See gh-8452.
|
| 627 |
+
class MyArray(np.ndarray):
|
| 628 |
+
def __eq__(self, other):
|
| 629 |
+
return super().__eq__(other).view(np.ndarray)
|
| 630 |
+
|
| 631 |
+
def __lt__(self, other):
|
| 632 |
+
return super().__lt__(other).view(np.ndarray)
|
| 633 |
+
|
| 634 |
+
def all(self, *args, **kwargs):
|
| 635 |
+
raise NotImplementedError
|
| 636 |
+
|
| 637 |
+
a = np.array([1., 2.]).view(MyArray)
|
| 638 |
+
self._assert_func(a, a)
|
| 639 |
+
|
| 640 |
+
|
| 641 |
+
class TestApproxEqual:
|
| 642 |
+
|
| 643 |
+
def setup_method(self):
|
| 644 |
+
self._assert_func = assert_approx_equal
|
| 645 |
+
|
| 646 |
+
def test_simple_0d_arrays(self):
|
| 647 |
+
x = np.array(1234.22)
|
| 648 |
+
y = np.array(1234.23)
|
| 649 |
+
|
| 650 |
+
self._assert_func(x, y, significant=5)
|
| 651 |
+
self._assert_func(x, y, significant=6)
|
| 652 |
+
assert_raises(AssertionError,
|
| 653 |
+
lambda: self._assert_func(x, y, significant=7))
|
| 654 |
+
|
| 655 |
+
def test_simple_items(self):
|
| 656 |
+
x = 1234.22
|
| 657 |
+
y = 1234.23
|
| 658 |
+
|
| 659 |
+
self._assert_func(x, y, significant=4)
|
| 660 |
+
self._assert_func(x, y, significant=5)
|
| 661 |
+
self._assert_func(x, y, significant=6)
|
| 662 |
+
assert_raises(AssertionError,
|
| 663 |
+
lambda: self._assert_func(x, y, significant=7))
|
| 664 |
+
|
| 665 |
+
def test_nan_array(self):
|
| 666 |
+
anan = np.array(np.nan)
|
| 667 |
+
aone = np.array(1)
|
| 668 |
+
ainf = np.array(np.inf)
|
| 669 |
+
self._assert_func(anan, anan)
|
| 670 |
+
assert_raises(AssertionError, lambda: self._assert_func(anan, aone))
|
| 671 |
+
assert_raises(AssertionError, lambda: self._assert_func(anan, ainf))
|
| 672 |
+
assert_raises(AssertionError, lambda: self._assert_func(ainf, anan))
|
| 673 |
+
|
| 674 |
+
def test_nan_items(self):
|
| 675 |
+
anan = np.array(np.nan)
|
| 676 |
+
aone = np.array(1)
|
| 677 |
+
ainf = np.array(np.inf)
|
| 678 |
+
self._assert_func(anan, anan)
|
| 679 |
+
assert_raises(AssertionError, lambda: self._assert_func(anan, aone))
|
| 680 |
+
assert_raises(AssertionError, lambda: self._assert_func(anan, ainf))
|
| 681 |
+
assert_raises(AssertionError, lambda: self._assert_func(ainf, anan))
|
| 682 |
+
|
| 683 |
+
|
| 684 |
+
class TestArrayAssertLess:
|
| 685 |
+
|
| 686 |
+
def setup_method(self):
|
| 687 |
+
self._assert_func = assert_array_less
|
| 688 |
+
|
| 689 |
+
def test_simple_arrays(self):
|
| 690 |
+
x = np.array([1.1, 2.2])
|
| 691 |
+
y = np.array([1.2, 2.3])
|
| 692 |
+
|
| 693 |
+
self._assert_func(x, y)
|
| 694 |
+
assert_raises(AssertionError, lambda: self._assert_func(y, x))
|
| 695 |
+
|
| 696 |
+
y = np.array([1.0, 2.3])
|
| 697 |
+
|
| 698 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, y))
|
| 699 |
+
assert_raises(AssertionError, lambda: self._assert_func(y, x))
|
| 700 |
+
|
| 701 |
+
def test_rank2(self):
|
| 702 |
+
x = np.array([[1.1, 2.2], [3.3, 4.4]])
|
| 703 |
+
y = np.array([[1.2, 2.3], [3.4, 4.5]])
|
| 704 |
+
|
| 705 |
+
self._assert_func(x, y)
|
| 706 |
+
assert_raises(AssertionError, lambda: self._assert_func(y, x))
|
| 707 |
+
|
| 708 |
+
y = np.array([[1.0, 2.3], [3.4, 4.5]])
|
| 709 |
+
|
| 710 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, y))
|
| 711 |
+
assert_raises(AssertionError, lambda: self._assert_func(y, x))
|
| 712 |
+
|
| 713 |
+
def test_rank3(self):
|
| 714 |
+
x = np.ones(shape=(2, 2, 2))
|
| 715 |
+
y = np.ones(shape=(2, 2, 2))+1
|
| 716 |
+
|
| 717 |
+
self._assert_func(x, y)
|
| 718 |
+
assert_raises(AssertionError, lambda: self._assert_func(y, x))
|
| 719 |
+
|
| 720 |
+
y[0, 0, 0] = 0
|
| 721 |
+
|
| 722 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, y))
|
| 723 |
+
assert_raises(AssertionError, lambda: self._assert_func(y, x))
|
| 724 |
+
|
| 725 |
+
def test_simple_items(self):
|
| 726 |
+
x = 1.1
|
| 727 |
+
y = 2.2
|
| 728 |
+
|
| 729 |
+
self._assert_func(x, y)
|
| 730 |
+
assert_raises(AssertionError, lambda: self._assert_func(y, x))
|
| 731 |
+
|
| 732 |
+
y = np.array([2.2, 3.3])
|
| 733 |
+
|
| 734 |
+
self._assert_func(x, y)
|
| 735 |
+
assert_raises(AssertionError, lambda: self._assert_func(y, x))
|
| 736 |
+
|
| 737 |
+
y = np.array([1.0, 3.3])
|
| 738 |
+
|
| 739 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, y))
|
| 740 |
+
|
| 741 |
+
def test_nan_noncompare(self):
|
| 742 |
+
anan = np.array(np.nan)
|
| 743 |
+
aone = np.array(1)
|
| 744 |
+
ainf = np.array(np.inf)
|
| 745 |
+
self._assert_func(anan, anan)
|
| 746 |
+
assert_raises(AssertionError, lambda: self._assert_func(aone, anan))
|
| 747 |
+
assert_raises(AssertionError, lambda: self._assert_func(anan, aone))
|
| 748 |
+
assert_raises(AssertionError, lambda: self._assert_func(anan, ainf))
|
| 749 |
+
assert_raises(AssertionError, lambda: self._assert_func(ainf, anan))
|
| 750 |
+
|
| 751 |
+
def test_nan_noncompare_array(self):
|
| 752 |
+
x = np.array([1.1, 2.2, 3.3])
|
| 753 |
+
anan = np.array(np.nan)
|
| 754 |
+
|
| 755 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, anan))
|
| 756 |
+
assert_raises(AssertionError, lambda: self._assert_func(anan, x))
|
| 757 |
+
|
| 758 |
+
x = np.array([1.1, 2.2, np.nan])
|
| 759 |
+
|
| 760 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, anan))
|
| 761 |
+
assert_raises(AssertionError, lambda: self._assert_func(anan, x))
|
| 762 |
+
|
| 763 |
+
y = np.array([1.0, 2.0, np.nan])
|
| 764 |
+
|
| 765 |
+
self._assert_func(y, x)
|
| 766 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, y))
|
| 767 |
+
|
| 768 |
+
def test_inf_compare(self):
|
| 769 |
+
aone = np.array(1)
|
| 770 |
+
ainf = np.array(np.inf)
|
| 771 |
+
|
| 772 |
+
self._assert_func(aone, ainf)
|
| 773 |
+
self._assert_func(-ainf, aone)
|
| 774 |
+
self._assert_func(-ainf, ainf)
|
| 775 |
+
assert_raises(AssertionError, lambda: self._assert_func(ainf, aone))
|
| 776 |
+
assert_raises(AssertionError, lambda: self._assert_func(aone, -ainf))
|
| 777 |
+
assert_raises(AssertionError, lambda: self._assert_func(ainf, ainf))
|
| 778 |
+
assert_raises(AssertionError, lambda: self._assert_func(ainf, -ainf))
|
| 779 |
+
assert_raises(AssertionError, lambda: self._assert_func(-ainf, -ainf))
|
| 780 |
+
|
| 781 |
+
def test_inf_compare_array(self):
|
| 782 |
+
x = np.array([1.1, 2.2, np.inf])
|
| 783 |
+
ainf = np.array(np.inf)
|
| 784 |
+
|
| 785 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, ainf))
|
| 786 |
+
assert_raises(AssertionError, lambda: self._assert_func(ainf, x))
|
| 787 |
+
assert_raises(AssertionError, lambda: self._assert_func(x, -ainf))
|
| 788 |
+
assert_raises(AssertionError, lambda: self._assert_func(-x, -ainf))
|
| 789 |
+
assert_raises(AssertionError, lambda: self._assert_func(-ainf, -x))
|
| 790 |
+
self._assert_func(-ainf, x)
|
| 791 |
+
|
| 792 |
+
|
| 793 |
+
class TestWarns:
|
| 794 |
+
|
| 795 |
+
def test_warn(self):
|
| 796 |
+
def f():
|
| 797 |
+
warnings.warn("yo")
|
| 798 |
+
return 3
|
| 799 |
+
|
| 800 |
+
before_filters = sys.modules['warnings'].filters[:]
|
| 801 |
+
assert_equal(assert_warns(UserWarning, f), 3)
|
| 802 |
+
after_filters = sys.modules['warnings'].filters
|
| 803 |
+
|
| 804 |
+
assert_raises(AssertionError, assert_no_warnings, f)
|
| 805 |
+
assert_equal(assert_no_warnings(lambda x: x, 1), 1)
|
| 806 |
+
|
| 807 |
+
# Check that the warnings state is unchanged
|
| 808 |
+
assert_equal(before_filters, after_filters,
|
| 809 |
+
"assert_warns does not preserver warnings state")
|
| 810 |
+
|
| 811 |
+
def test_context_manager(self):
|
| 812 |
+
|
| 813 |
+
before_filters = sys.modules['warnings'].filters[:]
|
| 814 |
+
with assert_warns(UserWarning):
|
| 815 |
+
warnings.warn("yo")
|
| 816 |
+
after_filters = sys.modules['warnings'].filters
|
| 817 |
+
|
| 818 |
+
def no_warnings():
|
| 819 |
+
with assert_no_warnings():
|
| 820 |
+
warnings.warn("yo")
|
| 821 |
+
|
| 822 |
+
assert_raises(AssertionError, no_warnings)
|
| 823 |
+
assert_equal(before_filters, after_filters,
|
| 824 |
+
"assert_warns does not preserver warnings state")
|
| 825 |
+
|
| 826 |
+
def test_warn_wrong_warning(self):
|
| 827 |
+
def f():
|
| 828 |
+
warnings.warn("yo", DeprecationWarning)
|
| 829 |
+
|
| 830 |
+
failed = False
|
| 831 |
+
with warnings.catch_warnings():
|
| 832 |
+
warnings.simplefilter("error", DeprecationWarning)
|
| 833 |
+
try:
|
| 834 |
+
# Should raise a DeprecationWarning
|
| 835 |
+
assert_warns(UserWarning, f)
|
| 836 |
+
failed = True
|
| 837 |
+
except DeprecationWarning:
|
| 838 |
+
pass
|
| 839 |
+
|
| 840 |
+
if failed:
|
| 841 |
+
raise AssertionError("wrong warning caught by assert_warn")
|
| 842 |
+
|
| 843 |
+
|
| 844 |
+
class TestAssertAllclose:
|
| 845 |
+
|
| 846 |
+
def test_simple(self):
|
| 847 |
+
x = 1e-3
|
| 848 |
+
y = 1e-9
|
| 849 |
+
|
| 850 |
+
assert_allclose(x, y, atol=1)
|
| 851 |
+
assert_raises(AssertionError, assert_allclose, x, y)
|
| 852 |
+
|
| 853 |
+
a = np.array([x, y, x, y])
|
| 854 |
+
b = np.array([x, y, x, x])
|
| 855 |
+
|
| 856 |
+
assert_allclose(a, b, atol=1)
|
| 857 |
+
assert_raises(AssertionError, assert_allclose, a, b)
|
| 858 |
+
|
| 859 |
+
b[-1] = y * (1 + 1e-8)
|
| 860 |
+
assert_allclose(a, b)
|
| 861 |
+
assert_raises(AssertionError, assert_allclose, a, b, rtol=1e-9)
|
| 862 |
+
|
| 863 |
+
assert_allclose(6, 10, rtol=0.5)
|
| 864 |
+
assert_raises(AssertionError, assert_allclose, 10, 6, rtol=0.5)
|
| 865 |
+
|
| 866 |
+
def test_min_int(self):
|
| 867 |
+
a = np.array([np.iinfo(np.int_).min], dtype=np.int_)
|
| 868 |
+
# Should not raise:
|
| 869 |
+
assert_allclose(a, a)
|
| 870 |
+
|
| 871 |
+
def test_report_fail_percentage(self):
|
| 872 |
+
a = np.array([1, 1, 1, 1])
|
| 873 |
+
b = np.array([1, 1, 1, 2])
|
| 874 |
+
|
| 875 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 876 |
+
assert_allclose(a, b)
|
| 877 |
+
msg = str(exc_info.value)
|
| 878 |
+
assert_('Mismatched elements: 1 / 4 (25%)\n'
|
| 879 |
+
'Max absolute difference: 1\n'
|
| 880 |
+
'Max relative difference: 0.5' in msg)
|
| 881 |
+
|
| 882 |
+
def test_equal_nan(self):
|
| 883 |
+
a = np.array([np.nan])
|
| 884 |
+
b = np.array([np.nan])
|
| 885 |
+
# Should not raise:
|
| 886 |
+
assert_allclose(a, b, equal_nan=True)
|
| 887 |
+
|
| 888 |
+
def test_not_equal_nan(self):
|
| 889 |
+
a = np.array([np.nan])
|
| 890 |
+
b = np.array([np.nan])
|
| 891 |
+
assert_raises(AssertionError, assert_allclose, a, b, equal_nan=False)
|
| 892 |
+
|
| 893 |
+
def test_equal_nan_default(self):
|
| 894 |
+
# Make sure equal_nan default behavior remains unchanged. (All
|
| 895 |
+
# of these functions use assert_array_compare under the hood.)
|
| 896 |
+
# None of these should raise.
|
| 897 |
+
a = np.array([np.nan])
|
| 898 |
+
b = np.array([np.nan])
|
| 899 |
+
assert_array_equal(a, b)
|
| 900 |
+
assert_array_almost_equal(a, b)
|
| 901 |
+
assert_array_less(a, b)
|
| 902 |
+
assert_allclose(a, b)
|
| 903 |
+
|
| 904 |
+
def test_report_max_relative_error(self):
|
| 905 |
+
a = np.array([0, 1])
|
| 906 |
+
b = np.array([0, 2])
|
| 907 |
+
|
| 908 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 909 |
+
assert_allclose(a, b)
|
| 910 |
+
msg = str(exc_info.value)
|
| 911 |
+
assert_('Max relative difference: 0.5' in msg)
|
| 912 |
+
|
| 913 |
+
def test_timedelta(self):
|
| 914 |
+
# see gh-18286
|
| 915 |
+
a = np.array([[1, 2, 3, "NaT"]], dtype="m8[ns]")
|
| 916 |
+
assert_allclose(a, a)
|
| 917 |
+
|
| 918 |
+
def test_error_message_unsigned(self):
|
| 919 |
+
"""Check the the message is formatted correctly when overflow can occur
|
| 920 |
+
(gh21768)"""
|
| 921 |
+
# Ensure to test for potential overflow in the case of:
|
| 922 |
+
# x - y
|
| 923 |
+
# and
|
| 924 |
+
# y - x
|
| 925 |
+
x = np.asarray([0, 1, 8], dtype='uint8')
|
| 926 |
+
y = np.asarray([4, 4, 4], dtype='uint8')
|
| 927 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 928 |
+
assert_allclose(x, y, atol=3)
|
| 929 |
+
msgs = str(exc_info.value).split('\n')
|
| 930 |
+
assert_equal(msgs[4], 'Max absolute difference: 4')
|
| 931 |
+
|
| 932 |
+
|
| 933 |
+
class TestArrayAlmostEqualNulp:
|
| 934 |
+
|
| 935 |
+
def test_float64_pass(self):
|
| 936 |
+
# The number of units of least precision
|
| 937 |
+
# In this case, use a few places above the lowest level (ie nulp=1)
|
| 938 |
+
nulp = 5
|
| 939 |
+
x = np.linspace(-20, 20, 50, dtype=np.float64)
|
| 940 |
+
x = 10**x
|
| 941 |
+
x = np.r_[-x, x]
|
| 942 |
+
|
| 943 |
+
# Addition
|
| 944 |
+
eps = np.finfo(x.dtype).eps
|
| 945 |
+
y = x + x*eps*nulp/2.
|
| 946 |
+
assert_array_almost_equal_nulp(x, y, nulp)
|
| 947 |
+
|
| 948 |
+
# Subtraction
|
| 949 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 950 |
+
y = x - x*epsneg*nulp/2.
|
| 951 |
+
assert_array_almost_equal_nulp(x, y, nulp)
|
| 952 |
+
|
| 953 |
+
def test_float64_fail(self):
|
| 954 |
+
nulp = 5
|
| 955 |
+
x = np.linspace(-20, 20, 50, dtype=np.float64)
|
| 956 |
+
x = 10**x
|
| 957 |
+
x = np.r_[-x, x]
|
| 958 |
+
|
| 959 |
+
eps = np.finfo(x.dtype).eps
|
| 960 |
+
y = x + x*eps*nulp*2.
|
| 961 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 962 |
+
x, y, nulp)
|
| 963 |
+
|
| 964 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 965 |
+
y = x - x*epsneg*nulp*2.
|
| 966 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 967 |
+
x, y, nulp)
|
| 968 |
+
|
| 969 |
+
def test_float64_ignore_nan(self):
|
| 970 |
+
# Ignore ULP differences between various NAN's
|
| 971 |
+
# Note that MIPS may reverse quiet and signaling nans
|
| 972 |
+
# so we use the builtin version as a base.
|
| 973 |
+
offset = np.uint64(0xffffffff)
|
| 974 |
+
nan1_i64 = np.array(np.nan, dtype=np.float64).view(np.uint64)
|
| 975 |
+
nan2_i64 = nan1_i64 ^ offset # nan payload on MIPS is all ones.
|
| 976 |
+
nan1_f64 = nan1_i64.view(np.float64)
|
| 977 |
+
nan2_f64 = nan2_i64.view(np.float64)
|
| 978 |
+
assert_array_max_ulp(nan1_f64, nan2_f64, 0)
|
| 979 |
+
|
| 980 |
+
def test_float32_pass(self):
|
| 981 |
+
nulp = 5
|
| 982 |
+
x = np.linspace(-20, 20, 50, dtype=np.float32)
|
| 983 |
+
x = 10**x
|
| 984 |
+
x = np.r_[-x, x]
|
| 985 |
+
|
| 986 |
+
eps = np.finfo(x.dtype).eps
|
| 987 |
+
y = x + x*eps*nulp/2.
|
| 988 |
+
assert_array_almost_equal_nulp(x, y, nulp)
|
| 989 |
+
|
| 990 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 991 |
+
y = x - x*epsneg*nulp/2.
|
| 992 |
+
assert_array_almost_equal_nulp(x, y, nulp)
|
| 993 |
+
|
| 994 |
+
def test_float32_fail(self):
|
| 995 |
+
nulp = 5
|
| 996 |
+
x = np.linspace(-20, 20, 50, dtype=np.float32)
|
| 997 |
+
x = 10**x
|
| 998 |
+
x = np.r_[-x, x]
|
| 999 |
+
|
| 1000 |
+
eps = np.finfo(x.dtype).eps
|
| 1001 |
+
y = x + x*eps*nulp*2.
|
| 1002 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1003 |
+
x, y, nulp)
|
| 1004 |
+
|
| 1005 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 1006 |
+
y = x - x*epsneg*nulp*2.
|
| 1007 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1008 |
+
x, y, nulp)
|
| 1009 |
+
|
| 1010 |
+
def test_float32_ignore_nan(self):
|
| 1011 |
+
# Ignore ULP differences between various NAN's
|
| 1012 |
+
# Note that MIPS may reverse quiet and signaling nans
|
| 1013 |
+
# so we use the builtin version as a base.
|
| 1014 |
+
offset = np.uint32(0xffff)
|
| 1015 |
+
nan1_i32 = np.array(np.nan, dtype=np.float32).view(np.uint32)
|
| 1016 |
+
nan2_i32 = nan1_i32 ^ offset # nan payload on MIPS is all ones.
|
| 1017 |
+
nan1_f32 = nan1_i32.view(np.float32)
|
| 1018 |
+
nan2_f32 = nan2_i32.view(np.float32)
|
| 1019 |
+
assert_array_max_ulp(nan1_f32, nan2_f32, 0)
|
| 1020 |
+
|
| 1021 |
+
def test_float16_pass(self):
|
| 1022 |
+
nulp = 5
|
| 1023 |
+
x = np.linspace(-4, 4, 10, dtype=np.float16)
|
| 1024 |
+
x = 10**x
|
| 1025 |
+
x = np.r_[-x, x]
|
| 1026 |
+
|
| 1027 |
+
eps = np.finfo(x.dtype).eps
|
| 1028 |
+
y = x + x*eps*nulp/2.
|
| 1029 |
+
assert_array_almost_equal_nulp(x, y, nulp)
|
| 1030 |
+
|
| 1031 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 1032 |
+
y = x - x*epsneg*nulp/2.
|
| 1033 |
+
assert_array_almost_equal_nulp(x, y, nulp)
|
| 1034 |
+
|
| 1035 |
+
def test_float16_fail(self):
|
| 1036 |
+
nulp = 5
|
| 1037 |
+
x = np.linspace(-4, 4, 10, dtype=np.float16)
|
| 1038 |
+
x = 10**x
|
| 1039 |
+
x = np.r_[-x, x]
|
| 1040 |
+
|
| 1041 |
+
eps = np.finfo(x.dtype).eps
|
| 1042 |
+
y = x + x*eps*nulp*2.
|
| 1043 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1044 |
+
x, y, nulp)
|
| 1045 |
+
|
| 1046 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 1047 |
+
y = x - x*epsneg*nulp*2.
|
| 1048 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1049 |
+
x, y, nulp)
|
| 1050 |
+
|
| 1051 |
+
def test_float16_ignore_nan(self):
|
| 1052 |
+
# Ignore ULP differences between various NAN's
|
| 1053 |
+
# Note that MIPS may reverse quiet and signaling nans
|
| 1054 |
+
# so we use the builtin version as a base.
|
| 1055 |
+
offset = np.uint16(0xff)
|
| 1056 |
+
nan1_i16 = np.array(np.nan, dtype=np.float16).view(np.uint16)
|
| 1057 |
+
nan2_i16 = nan1_i16 ^ offset # nan payload on MIPS is all ones.
|
| 1058 |
+
nan1_f16 = nan1_i16.view(np.float16)
|
| 1059 |
+
nan2_f16 = nan2_i16.view(np.float16)
|
| 1060 |
+
assert_array_max_ulp(nan1_f16, nan2_f16, 0)
|
| 1061 |
+
|
| 1062 |
+
def test_complex128_pass(self):
|
| 1063 |
+
nulp = 5
|
| 1064 |
+
x = np.linspace(-20, 20, 50, dtype=np.float64)
|
| 1065 |
+
x = 10**x
|
| 1066 |
+
x = np.r_[-x, x]
|
| 1067 |
+
xi = x + x*1j
|
| 1068 |
+
|
| 1069 |
+
eps = np.finfo(x.dtype).eps
|
| 1070 |
+
y = x + x*eps*nulp/2.
|
| 1071 |
+
assert_array_almost_equal_nulp(xi, x + y*1j, nulp)
|
| 1072 |
+
assert_array_almost_equal_nulp(xi, y + x*1j, nulp)
|
| 1073 |
+
# The test condition needs to be at least a factor of sqrt(2) smaller
|
| 1074 |
+
# because the real and imaginary parts both change
|
| 1075 |
+
y = x + x*eps*nulp/4.
|
| 1076 |
+
assert_array_almost_equal_nulp(xi, y + y*1j, nulp)
|
| 1077 |
+
|
| 1078 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 1079 |
+
y = x - x*epsneg*nulp/2.
|
| 1080 |
+
assert_array_almost_equal_nulp(xi, x + y*1j, nulp)
|
| 1081 |
+
assert_array_almost_equal_nulp(xi, y + x*1j, nulp)
|
| 1082 |
+
y = x - x*epsneg*nulp/4.
|
| 1083 |
+
assert_array_almost_equal_nulp(xi, y + y*1j, nulp)
|
| 1084 |
+
|
| 1085 |
+
def test_complex128_fail(self):
|
| 1086 |
+
nulp = 5
|
| 1087 |
+
x = np.linspace(-20, 20, 50, dtype=np.float64)
|
| 1088 |
+
x = 10**x
|
| 1089 |
+
x = np.r_[-x, x]
|
| 1090 |
+
xi = x + x*1j
|
| 1091 |
+
|
| 1092 |
+
eps = np.finfo(x.dtype).eps
|
| 1093 |
+
y = x + x*eps*nulp*2.
|
| 1094 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1095 |
+
xi, x + y*1j, nulp)
|
| 1096 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1097 |
+
xi, y + x*1j, nulp)
|
| 1098 |
+
# The test condition needs to be at least a factor of sqrt(2) smaller
|
| 1099 |
+
# because the real and imaginary parts both change
|
| 1100 |
+
y = x + x*eps*nulp
|
| 1101 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1102 |
+
xi, y + y*1j, nulp)
|
| 1103 |
+
|
| 1104 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 1105 |
+
y = x - x*epsneg*nulp*2.
|
| 1106 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1107 |
+
xi, x + y*1j, nulp)
|
| 1108 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1109 |
+
xi, y + x*1j, nulp)
|
| 1110 |
+
y = x - x*epsneg*nulp
|
| 1111 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1112 |
+
xi, y + y*1j, nulp)
|
| 1113 |
+
|
| 1114 |
+
def test_complex64_pass(self):
|
| 1115 |
+
nulp = 5
|
| 1116 |
+
x = np.linspace(-20, 20, 50, dtype=np.float32)
|
| 1117 |
+
x = 10**x
|
| 1118 |
+
x = np.r_[-x, x]
|
| 1119 |
+
xi = x + x*1j
|
| 1120 |
+
|
| 1121 |
+
eps = np.finfo(x.dtype).eps
|
| 1122 |
+
y = x + x*eps*nulp/2.
|
| 1123 |
+
assert_array_almost_equal_nulp(xi, x + y*1j, nulp)
|
| 1124 |
+
assert_array_almost_equal_nulp(xi, y + x*1j, nulp)
|
| 1125 |
+
y = x + x*eps*nulp/4.
|
| 1126 |
+
assert_array_almost_equal_nulp(xi, y + y*1j, nulp)
|
| 1127 |
+
|
| 1128 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 1129 |
+
y = x - x*epsneg*nulp/2.
|
| 1130 |
+
assert_array_almost_equal_nulp(xi, x + y*1j, nulp)
|
| 1131 |
+
assert_array_almost_equal_nulp(xi, y + x*1j, nulp)
|
| 1132 |
+
y = x - x*epsneg*nulp/4.
|
| 1133 |
+
assert_array_almost_equal_nulp(xi, y + y*1j, nulp)
|
| 1134 |
+
|
| 1135 |
+
def test_complex64_fail(self):
|
| 1136 |
+
nulp = 5
|
| 1137 |
+
x = np.linspace(-20, 20, 50, dtype=np.float32)
|
| 1138 |
+
x = 10**x
|
| 1139 |
+
x = np.r_[-x, x]
|
| 1140 |
+
xi = x + x*1j
|
| 1141 |
+
|
| 1142 |
+
eps = np.finfo(x.dtype).eps
|
| 1143 |
+
y = x + x*eps*nulp*2.
|
| 1144 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1145 |
+
xi, x + y*1j, nulp)
|
| 1146 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1147 |
+
xi, y + x*1j, nulp)
|
| 1148 |
+
y = x + x*eps*nulp
|
| 1149 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1150 |
+
xi, y + y*1j, nulp)
|
| 1151 |
+
|
| 1152 |
+
epsneg = np.finfo(x.dtype).epsneg
|
| 1153 |
+
y = x - x*epsneg*nulp*2.
|
| 1154 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1155 |
+
xi, x + y*1j, nulp)
|
| 1156 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1157 |
+
xi, y + x*1j, nulp)
|
| 1158 |
+
y = x - x*epsneg*nulp
|
| 1159 |
+
assert_raises(AssertionError, assert_array_almost_equal_nulp,
|
| 1160 |
+
xi, y + y*1j, nulp)
|
| 1161 |
+
|
| 1162 |
+
|
| 1163 |
+
class TestULP:
|
| 1164 |
+
|
| 1165 |
+
def test_equal(self):
|
| 1166 |
+
x = np.random.randn(10)
|
| 1167 |
+
assert_array_max_ulp(x, x, maxulp=0)
|
| 1168 |
+
|
| 1169 |
+
def test_single(self):
|
| 1170 |
+
# Generate 1 + small deviation, check that adding eps gives a few UNL
|
| 1171 |
+
x = np.ones(10).astype(np.float32)
|
| 1172 |
+
x += 0.01 * np.random.randn(10).astype(np.float32)
|
| 1173 |
+
eps = np.finfo(np.float32).eps
|
| 1174 |
+
assert_array_max_ulp(x, x+eps, maxulp=20)
|
| 1175 |
+
|
| 1176 |
+
def test_double(self):
|
| 1177 |
+
# Generate 1 + small deviation, check that adding eps gives a few UNL
|
| 1178 |
+
x = np.ones(10).astype(np.float64)
|
| 1179 |
+
x += 0.01 * np.random.randn(10).astype(np.float64)
|
| 1180 |
+
eps = np.finfo(np.float64).eps
|
| 1181 |
+
assert_array_max_ulp(x, x+eps, maxulp=200)
|
| 1182 |
+
|
| 1183 |
+
def test_inf(self):
|
| 1184 |
+
for dt in [np.float32, np.float64]:
|
| 1185 |
+
inf = np.array([np.inf]).astype(dt)
|
| 1186 |
+
big = np.array([np.finfo(dt).max])
|
| 1187 |
+
assert_array_max_ulp(inf, big, maxulp=200)
|
| 1188 |
+
|
| 1189 |
+
def test_nan(self):
|
| 1190 |
+
# Test that nan is 'far' from small, tiny, inf, max and min
|
| 1191 |
+
for dt in [np.float32, np.float64]:
|
| 1192 |
+
if dt == np.float32:
|
| 1193 |
+
maxulp = 1e6
|
| 1194 |
+
else:
|
| 1195 |
+
maxulp = 1e12
|
| 1196 |
+
inf = np.array([np.inf]).astype(dt)
|
| 1197 |
+
nan = np.array([np.nan]).astype(dt)
|
| 1198 |
+
big = np.array([np.finfo(dt).max])
|
| 1199 |
+
tiny = np.array([np.finfo(dt).tiny])
|
| 1200 |
+
zero = np.array([np.PZERO]).astype(dt)
|
| 1201 |
+
nzero = np.array([np.NZERO]).astype(dt)
|
| 1202 |
+
assert_raises(AssertionError,
|
| 1203 |
+
lambda: assert_array_max_ulp(nan, inf,
|
| 1204 |
+
maxulp=maxulp))
|
| 1205 |
+
assert_raises(AssertionError,
|
| 1206 |
+
lambda: assert_array_max_ulp(nan, big,
|
| 1207 |
+
maxulp=maxulp))
|
| 1208 |
+
assert_raises(AssertionError,
|
| 1209 |
+
lambda: assert_array_max_ulp(nan, tiny,
|
| 1210 |
+
maxulp=maxulp))
|
| 1211 |
+
assert_raises(AssertionError,
|
| 1212 |
+
lambda: assert_array_max_ulp(nan, zero,
|
| 1213 |
+
maxulp=maxulp))
|
| 1214 |
+
assert_raises(AssertionError,
|
| 1215 |
+
lambda: assert_array_max_ulp(nan, nzero,
|
| 1216 |
+
maxulp=maxulp))
|
| 1217 |
+
|
| 1218 |
+
|
| 1219 |
+
class TestStringEqual:
|
| 1220 |
+
def test_simple(self):
|
| 1221 |
+
assert_string_equal("hello", "hello")
|
| 1222 |
+
assert_string_equal("hello\nmultiline", "hello\nmultiline")
|
| 1223 |
+
|
| 1224 |
+
with pytest.raises(AssertionError) as exc_info:
|
| 1225 |
+
assert_string_equal("foo\nbar", "hello\nbar")
|
| 1226 |
+
msg = str(exc_info.value)
|
| 1227 |
+
assert_equal(msg, "Differences in strings:\n- foo\n+ hello")
|
| 1228 |
+
|
| 1229 |
+
assert_raises(AssertionError,
|
| 1230 |
+
lambda: assert_string_equal("foo", "hello"))
|
| 1231 |
+
|
| 1232 |
+
def test_regex(self):
|
| 1233 |
+
assert_string_equal("a+*b", "a+*b")
|
| 1234 |
+
|
| 1235 |
+
assert_raises(AssertionError,
|
| 1236 |
+
lambda: assert_string_equal("aaa", "a+b"))
|
| 1237 |
+
|
| 1238 |
+
|
| 1239 |
+
def assert_warn_len_equal(mod, n_in_context):
|
| 1240 |
+
try:
|
| 1241 |
+
mod_warns = mod.__warningregistry__
|
| 1242 |
+
except AttributeError:
|
| 1243 |
+
# the lack of a __warningregistry__
|
| 1244 |
+
# attribute means that no warning has
|
| 1245 |
+
# occurred; this can be triggered in
|
| 1246 |
+
# a parallel test scenario, while in
|
| 1247 |
+
# a serial test scenario an initial
|
| 1248 |
+
# warning (and therefore the attribute)
|
| 1249 |
+
# are always created first
|
| 1250 |
+
mod_warns = {}
|
| 1251 |
+
|
| 1252 |
+
num_warns = len(mod_warns)
|
| 1253 |
+
|
| 1254 |
+
if 'version' in mod_warns:
|
| 1255 |
+
# Python 3 adds a 'version' entry to the registry,
|
| 1256 |
+
# do not count it.
|
| 1257 |
+
num_warns -= 1
|
| 1258 |
+
|
| 1259 |
+
assert_equal(num_warns, n_in_context)
|
| 1260 |
+
|
| 1261 |
+
|
| 1262 |
+
def test_warn_len_equal_call_scenarios():
|
| 1263 |
+
# assert_warn_len_equal is called under
|
| 1264 |
+
# varying circumstances depending on serial
|
| 1265 |
+
# vs. parallel test scenarios; this test
|
| 1266 |
+
# simply aims to probe both code paths and
|
| 1267 |
+
# check that no assertion is uncaught
|
| 1268 |
+
|
| 1269 |
+
# parallel scenario -- no warning issued yet
|
| 1270 |
+
class mod:
|
| 1271 |
+
pass
|
| 1272 |
+
|
| 1273 |
+
mod_inst = mod()
|
| 1274 |
+
|
| 1275 |
+
assert_warn_len_equal(mod=mod_inst,
|
| 1276 |
+
n_in_context=0)
|
| 1277 |
+
|
| 1278 |
+
# serial test scenario -- the __warningregistry__
|
| 1279 |
+
# attribute should be present
|
| 1280 |
+
class mod:
|
| 1281 |
+
def __init__(self):
|
| 1282 |
+
self.__warningregistry__ = {'warning1':1,
|
| 1283 |
+
'warning2':2}
|
| 1284 |
+
|
| 1285 |
+
mod_inst = mod()
|
| 1286 |
+
assert_warn_len_equal(mod=mod_inst,
|
| 1287 |
+
n_in_context=2)
|
| 1288 |
+
|
| 1289 |
+
|
| 1290 |
+
def _get_fresh_mod():
|
| 1291 |
+
# Get this module, with warning registry empty
|
| 1292 |
+
my_mod = sys.modules[__name__]
|
| 1293 |
+
try:
|
| 1294 |
+
my_mod.__warningregistry__.clear()
|
| 1295 |
+
except AttributeError:
|
| 1296 |
+
# will not have a __warningregistry__ unless warning has been
|
| 1297 |
+
# raised in the module at some point
|
| 1298 |
+
pass
|
| 1299 |
+
return my_mod
|
| 1300 |
+
|
| 1301 |
+
|
| 1302 |
+
def test_clear_and_catch_warnings():
|
| 1303 |
+
# Initial state of module, no warnings
|
| 1304 |
+
my_mod = _get_fresh_mod()
|
| 1305 |
+
assert_equal(getattr(my_mod, '__warningregistry__', {}), {})
|
| 1306 |
+
with clear_and_catch_warnings(modules=[my_mod]):
|
| 1307 |
+
warnings.simplefilter('ignore')
|
| 1308 |
+
warnings.warn('Some warning')
|
| 1309 |
+
assert_equal(my_mod.__warningregistry__, {})
|
| 1310 |
+
# Without specified modules, don't clear warnings during context.
|
| 1311 |
+
# catch_warnings doesn't make an entry for 'ignore'.
|
| 1312 |
+
with clear_and_catch_warnings():
|
| 1313 |
+
warnings.simplefilter('ignore')
|
| 1314 |
+
warnings.warn('Some warning')
|
| 1315 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1316 |
+
|
| 1317 |
+
# Manually adding two warnings to the registry:
|
| 1318 |
+
my_mod.__warningregistry__ = {'warning1': 1,
|
| 1319 |
+
'warning2': 2}
|
| 1320 |
+
|
| 1321 |
+
# Confirm that specifying module keeps old warning, does not add new
|
| 1322 |
+
with clear_and_catch_warnings(modules=[my_mod]):
|
| 1323 |
+
warnings.simplefilter('ignore')
|
| 1324 |
+
warnings.warn('Another warning')
|
| 1325 |
+
assert_warn_len_equal(my_mod, 2)
|
| 1326 |
+
|
| 1327 |
+
# Another warning, no module spec it clears up registry
|
| 1328 |
+
with clear_and_catch_warnings():
|
| 1329 |
+
warnings.simplefilter('ignore')
|
| 1330 |
+
warnings.warn('Another warning')
|
| 1331 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1332 |
+
|
| 1333 |
+
|
| 1334 |
+
def test_suppress_warnings_module():
|
| 1335 |
+
# Initial state of module, no warnings
|
| 1336 |
+
my_mod = _get_fresh_mod()
|
| 1337 |
+
assert_equal(getattr(my_mod, '__warningregistry__', {}), {})
|
| 1338 |
+
|
| 1339 |
+
def warn_other_module():
|
| 1340 |
+
# Apply along axis is implemented in python; stacklevel=2 means
|
| 1341 |
+
# we end up inside its module, not ours.
|
| 1342 |
+
def warn(arr):
|
| 1343 |
+
warnings.warn("Some warning 2", stacklevel=2)
|
| 1344 |
+
return arr
|
| 1345 |
+
np.apply_along_axis(warn, 0, [0])
|
| 1346 |
+
|
| 1347 |
+
# Test module based warning suppression:
|
| 1348 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1349 |
+
with suppress_warnings() as sup:
|
| 1350 |
+
sup.record(UserWarning)
|
| 1351 |
+
# suppress warning from other module (may have .pyc ending),
|
| 1352 |
+
# if apply_along_axis is moved, had to be changed.
|
| 1353 |
+
sup.filter(module=np.lib.shape_base)
|
| 1354 |
+
warnings.warn("Some warning")
|
| 1355 |
+
warn_other_module()
|
| 1356 |
+
# Check that the suppression did test the file correctly (this module
|
| 1357 |
+
# got filtered)
|
| 1358 |
+
assert_equal(len(sup.log), 1)
|
| 1359 |
+
assert_equal(sup.log[0].message.args[0], "Some warning")
|
| 1360 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1361 |
+
sup = suppress_warnings()
|
| 1362 |
+
# Will have to be changed if apply_along_axis is moved:
|
| 1363 |
+
sup.filter(module=my_mod)
|
| 1364 |
+
with sup:
|
| 1365 |
+
warnings.warn('Some warning')
|
| 1366 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1367 |
+
# And test repeat works:
|
| 1368 |
+
sup.filter(module=my_mod)
|
| 1369 |
+
with sup:
|
| 1370 |
+
warnings.warn('Some warning')
|
| 1371 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1372 |
+
|
| 1373 |
+
# Without specified modules
|
| 1374 |
+
with suppress_warnings():
|
| 1375 |
+
warnings.simplefilter('ignore')
|
| 1376 |
+
warnings.warn('Some warning')
|
| 1377 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1378 |
+
|
| 1379 |
+
|
| 1380 |
+
def test_suppress_warnings_type():
|
| 1381 |
+
# Initial state of module, no warnings
|
| 1382 |
+
my_mod = _get_fresh_mod()
|
| 1383 |
+
assert_equal(getattr(my_mod, '__warningregistry__', {}), {})
|
| 1384 |
+
|
| 1385 |
+
# Test module based warning suppression:
|
| 1386 |
+
with suppress_warnings() as sup:
|
| 1387 |
+
sup.filter(UserWarning)
|
| 1388 |
+
warnings.warn('Some warning')
|
| 1389 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1390 |
+
sup = suppress_warnings()
|
| 1391 |
+
sup.filter(UserWarning)
|
| 1392 |
+
with sup:
|
| 1393 |
+
warnings.warn('Some warning')
|
| 1394 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1395 |
+
# And test repeat works:
|
| 1396 |
+
sup.filter(module=my_mod)
|
| 1397 |
+
with sup:
|
| 1398 |
+
warnings.warn('Some warning')
|
| 1399 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1400 |
+
|
| 1401 |
+
# Without specified modules
|
| 1402 |
+
with suppress_warnings():
|
| 1403 |
+
warnings.simplefilter('ignore')
|
| 1404 |
+
warnings.warn('Some warning')
|
| 1405 |
+
assert_warn_len_equal(my_mod, 0)
|
| 1406 |
+
|
| 1407 |
+
|
| 1408 |
+
def test_suppress_warnings_decorate_no_record():
|
| 1409 |
+
sup = suppress_warnings()
|
| 1410 |
+
sup.filter(UserWarning)
|
| 1411 |
+
|
| 1412 |
+
@sup
|
| 1413 |
+
def warn(category):
|
| 1414 |
+
warnings.warn('Some warning', category)
|
| 1415 |
+
|
| 1416 |
+
with warnings.catch_warnings(record=True) as w:
|
| 1417 |
+
warnings.simplefilter("always")
|
| 1418 |
+
warn(UserWarning) # should be supppressed
|
| 1419 |
+
warn(RuntimeWarning)
|
| 1420 |
+
assert_equal(len(w), 1)
|
| 1421 |
+
|
| 1422 |
+
|
| 1423 |
+
def test_suppress_warnings_record():
|
| 1424 |
+
sup = suppress_warnings()
|
| 1425 |
+
log1 = sup.record()
|
| 1426 |
+
|
| 1427 |
+
with sup:
|
| 1428 |
+
log2 = sup.record(message='Some other warning 2')
|
| 1429 |
+
sup.filter(message='Some warning')
|
| 1430 |
+
warnings.warn('Some warning')
|
| 1431 |
+
warnings.warn('Some other warning')
|
| 1432 |
+
warnings.warn('Some other warning 2')
|
| 1433 |
+
|
| 1434 |
+
assert_equal(len(sup.log), 2)
|
| 1435 |
+
assert_equal(len(log1), 1)
|
| 1436 |
+
assert_equal(len(log2),1)
|
| 1437 |
+
assert_equal(log2[0].message.args[0], 'Some other warning 2')
|
| 1438 |
+
|
| 1439 |
+
# Do it again, with the same context to see if some warnings survived:
|
| 1440 |
+
with sup:
|
| 1441 |
+
log2 = sup.record(message='Some other warning 2')
|
| 1442 |
+
sup.filter(message='Some warning')
|
| 1443 |
+
warnings.warn('Some warning')
|
| 1444 |
+
warnings.warn('Some other warning')
|
| 1445 |
+
warnings.warn('Some other warning 2')
|
| 1446 |
+
|
| 1447 |
+
assert_equal(len(sup.log), 2)
|
| 1448 |
+
assert_equal(len(log1), 1)
|
| 1449 |
+
assert_equal(len(log2), 1)
|
| 1450 |
+
assert_equal(log2[0].message.args[0], 'Some other warning 2')
|
| 1451 |
+
|
| 1452 |
+
# Test nested:
|
| 1453 |
+
with suppress_warnings() as sup:
|
| 1454 |
+
sup.record()
|
| 1455 |
+
with suppress_warnings() as sup2:
|
| 1456 |
+
sup2.record(message='Some warning')
|
| 1457 |
+
warnings.warn('Some warning')
|
| 1458 |
+
warnings.warn('Some other warning')
|
| 1459 |
+
assert_equal(len(sup2.log), 1)
|
| 1460 |
+
assert_equal(len(sup.log), 1)
|
| 1461 |
+
|
| 1462 |
+
|
| 1463 |
+
def test_suppress_warnings_forwarding():
|
| 1464 |
+
def warn_other_module():
|
| 1465 |
+
# Apply along axis is implemented in python; stacklevel=2 means
|
| 1466 |
+
# we end up inside its module, not ours.
|
| 1467 |
+
def warn(arr):
|
| 1468 |
+
warnings.warn("Some warning", stacklevel=2)
|
| 1469 |
+
return arr
|
| 1470 |
+
np.apply_along_axis(warn, 0, [0])
|
| 1471 |
+
|
| 1472 |
+
with suppress_warnings() as sup:
|
| 1473 |
+
sup.record()
|
| 1474 |
+
with suppress_warnings("always"):
|
| 1475 |
+
for i in range(2):
|
| 1476 |
+
warnings.warn("Some warning")
|
| 1477 |
+
|
| 1478 |
+
assert_equal(len(sup.log), 2)
|
| 1479 |
+
|
| 1480 |
+
with suppress_warnings() as sup:
|
| 1481 |
+
sup.record()
|
| 1482 |
+
with suppress_warnings("location"):
|
| 1483 |
+
for i in range(2):
|
| 1484 |
+
warnings.warn("Some warning")
|
| 1485 |
+
warnings.warn("Some warning")
|
| 1486 |
+
|
| 1487 |
+
assert_equal(len(sup.log), 2)
|
| 1488 |
+
|
| 1489 |
+
with suppress_warnings() as sup:
|
| 1490 |
+
sup.record()
|
| 1491 |
+
with suppress_warnings("module"):
|
| 1492 |
+
for i in range(2):
|
| 1493 |
+
warnings.warn("Some warning")
|
| 1494 |
+
warnings.warn("Some warning")
|
| 1495 |
+
warn_other_module()
|
| 1496 |
+
|
| 1497 |
+
assert_equal(len(sup.log), 2)
|
| 1498 |
+
|
| 1499 |
+
with suppress_warnings() as sup:
|
| 1500 |
+
sup.record()
|
| 1501 |
+
with suppress_warnings("once"):
|
| 1502 |
+
for i in range(2):
|
| 1503 |
+
warnings.warn("Some warning")
|
| 1504 |
+
warnings.warn("Some other warning")
|
| 1505 |
+
warn_other_module()
|
| 1506 |
+
|
| 1507 |
+
assert_equal(len(sup.log), 2)
|
| 1508 |
+
|
| 1509 |
+
|
| 1510 |
+
def test_tempdir():
|
| 1511 |
+
with tempdir() as tdir:
|
| 1512 |
+
fpath = os.path.join(tdir, 'tmp')
|
| 1513 |
+
with open(fpath, 'w'):
|
| 1514 |
+
pass
|
| 1515 |
+
assert_(not os.path.isdir(tdir))
|
| 1516 |
+
|
| 1517 |
+
raised = False
|
| 1518 |
+
try:
|
| 1519 |
+
with tempdir() as tdir:
|
| 1520 |
+
raise ValueError()
|
| 1521 |
+
except ValueError:
|
| 1522 |
+
raised = True
|
| 1523 |
+
assert_(raised)
|
| 1524 |
+
assert_(not os.path.isdir(tdir))
|
| 1525 |
+
|
| 1526 |
+
|
| 1527 |
+
def test_temppath():
|
| 1528 |
+
with temppath() as fpath:
|
| 1529 |
+
with open(fpath, 'w'):
|
| 1530 |
+
pass
|
| 1531 |
+
assert_(not os.path.isfile(fpath))
|
| 1532 |
+
|
| 1533 |
+
raised = False
|
| 1534 |
+
try:
|
| 1535 |
+
with temppath() as fpath:
|
| 1536 |
+
raise ValueError()
|
| 1537 |
+
except ValueError:
|
| 1538 |
+
raised = True
|
| 1539 |
+
assert_(raised)
|
| 1540 |
+
assert_(not os.path.isfile(fpath))
|
| 1541 |
+
|
| 1542 |
+
|
| 1543 |
+
class my_cacw(clear_and_catch_warnings):
|
| 1544 |
+
|
| 1545 |
+
class_modules = (sys.modules[__name__],)
|
| 1546 |
+
|
| 1547 |
+
|
| 1548 |
+
def test_clear_and_catch_warnings_inherit():
|
| 1549 |
+
# Test can subclass and add default modules
|
| 1550 |
+
my_mod = _get_fresh_mod()
|
| 1551 |
+
with my_cacw():
|
| 1552 |
+
warnings.simplefilter('ignore')
|
| 1553 |
+
warnings.warn('Some warning')
|
| 1554 |
+
assert_equal(my_mod.__warningregistry__, {})
|
| 1555 |
+
|
| 1556 |
+
|
| 1557 |
+
@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
|
| 1558 |
+
class TestAssertNoGcCycles:
|
| 1559 |
+
""" Test assert_no_gc_cycles """
|
| 1560 |
+
def test_passes(self):
|
| 1561 |
+
def no_cycle():
|
| 1562 |
+
b = []
|
| 1563 |
+
b.append([])
|
| 1564 |
+
return b
|
| 1565 |
+
|
| 1566 |
+
with assert_no_gc_cycles():
|
| 1567 |
+
no_cycle()
|
| 1568 |
+
|
| 1569 |
+
assert_no_gc_cycles(no_cycle)
|
| 1570 |
+
|
| 1571 |
+
def test_asserts(self):
|
| 1572 |
+
def make_cycle():
|
| 1573 |
+
a = []
|
| 1574 |
+
a.append(a)
|
| 1575 |
+
a.append(a)
|
| 1576 |
+
return a
|
| 1577 |
+
|
| 1578 |
+
with assert_raises(AssertionError):
|
| 1579 |
+
with assert_no_gc_cycles():
|
| 1580 |
+
make_cycle()
|
| 1581 |
+
|
| 1582 |
+
with assert_raises(AssertionError):
|
| 1583 |
+
assert_no_gc_cycles(make_cycle)
|
| 1584 |
+
|
| 1585 |
+
@pytest.mark.slow
|
| 1586 |
+
def test_fails(self):
|
| 1587 |
+
"""
|
| 1588 |
+
Test that in cases where the garbage cannot be collected, we raise an
|
| 1589 |
+
error, instead of hanging forever trying to clear it.
|
| 1590 |
+
"""
|
| 1591 |
+
|
| 1592 |
+
class ReferenceCycleInDel:
|
| 1593 |
+
"""
|
| 1594 |
+
An object that not only contains a reference cycle, but creates new
|
| 1595 |
+
cycles whenever it's garbage-collected and its __del__ runs
|
| 1596 |
+
"""
|
| 1597 |
+
make_cycle = True
|
| 1598 |
+
|
| 1599 |
+
def __init__(self):
|
| 1600 |
+
self.cycle = self
|
| 1601 |
+
|
| 1602 |
+
def __del__(self):
|
| 1603 |
+
# break the current cycle so that `self` can be freed
|
| 1604 |
+
self.cycle = None
|
| 1605 |
+
|
| 1606 |
+
if ReferenceCycleInDel.make_cycle:
|
| 1607 |
+
# but create a new one so that the garbage collector has more
|
| 1608 |
+
# work to do.
|
| 1609 |
+
ReferenceCycleInDel()
|
| 1610 |
+
|
| 1611 |
+
try:
|
| 1612 |
+
w = weakref.ref(ReferenceCycleInDel())
|
| 1613 |
+
try:
|
| 1614 |
+
with assert_raises(RuntimeError):
|
| 1615 |
+
# this will be unable to get a baseline empty garbage
|
| 1616 |
+
assert_no_gc_cycles(lambda: None)
|
| 1617 |
+
except AssertionError:
|
| 1618 |
+
# the above test is only necessary if the GC actually tried to free
|
| 1619 |
+
# our object anyway, which python 2.7 does not.
|
| 1620 |
+
if w() is not None:
|
| 1621 |
+
pytest.skip("GC does not call __del__ on cyclic objects")
|
| 1622 |
+
raise
|
| 1623 |
+
|
| 1624 |
+
finally:
|
| 1625 |
+
# make sure that we stop creating reference cycles
|
| 1626 |
+
ReferenceCycleInDel.make_cycle = False
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/logs/infer_lr3e3_170k_logitnorm_aggressive_20260612/gpu0.log
ADDED
|
@@ -0,0 +1,372 @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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.8 s=1.1 gamma=1.0 =====
|
| 2 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 3 |
+
use_ema=1
|
| 4 |
+
step=170000
|
| 5 |
+
decode_steps=32
|
| 6 |
+
n=64 chunk_n=8 gpu=0
|
| 7 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 8 |
+
[2026-06-11T22:03:44+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p8_s1p1_sc1p0_decode32_n64
|
| 9 |
+
[2026-06-11T22:03:44+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 10 |
+
[2026-06-11T22:03:51+00:00] done decode=32 chunk=0
|
| 11 |
+
[2026-06-11T22:03:51+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 12 |
+
[2026-06-11T22:03:58+00:00] done decode=32 chunk=1
|
| 13 |
+
[2026-06-11T22:03:58+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 14 |
+
[2026-06-11T22:04:05+00:00] done decode=32 chunk=2
|
| 15 |
+
[2026-06-11T22:04:05+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 16 |
+
[2026-06-11T22:04:12+00:00] done decode=32 chunk=3
|
| 17 |
+
[2026-06-11T22:04:12+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 18 |
+
[2026-06-11T22:04:19+00:00] done decode=32 chunk=4
|
| 19 |
+
[2026-06-11T22:04:19+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 20 |
+
[2026-06-11T22:04:26+00:00] done decode=32 chunk=5
|
| 21 |
+
[2026-06-11T22:04:26+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 22 |
+
[2026-06-11T22:04:32+00:00] done decode=32 chunk=6
|
| 23 |
+
[2026-06-11T22:04:32+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 24 |
+
[2026-06-11T22:04:39+00:00] done decode=32 chunk=7
|
| 25 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p8_s1p1_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 26 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 27 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 28 |
+
sc1p0 raw_full 20.5805643950024 4.807979008544343 0.06177184839076573 0.3967046310385638 0.029433463465617413 60 62 60982 65062 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p8_s1p1_sc1p0_decode32_n64/sc1p0
|
| 29 |
+
sc1p0 pre_eos 23.54336837531175 4.8287998720181236 0.06354451594542034 0.40802580400341526 0.030278115958069157 0 0 57317 63247 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p8_s1p1_sc1p0_decode32_n64/sc1p0
|
| 30 |
+
[2026-06-11T22:05:11+00:00] done
|
| 31 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.8 s=1.1 gamma=1.0 =====
|
| 32 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.8 s=1.2 gamma=0.75 =====
|
| 33 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 34 |
+
use_ema=1
|
| 35 |
+
step=170000
|
| 36 |
+
decode_steps=32
|
| 37 |
+
n=64 chunk_n=8 gpu=0
|
| 38 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 39 |
+
[2026-06-11T22:05:11+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p8_s1p2_sc1p0_decode32_n64
|
| 40 |
+
[2026-06-11T22:05:11+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 41 |
+
[2026-06-11T22:05:18+00:00] done decode=32 chunk=0
|
| 42 |
+
[2026-06-11T22:05:18+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 43 |
+
[2026-06-11T22:05:24+00:00] done decode=32 chunk=1
|
| 44 |
+
[2026-06-11T22:05:24+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 45 |
+
[2026-06-11T22:05:31+00:00] done decode=32 chunk=2
|
| 46 |
+
[2026-06-11T22:05:31+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 47 |
+
[2026-06-11T22:05:38+00:00] done decode=32 chunk=3
|
| 48 |
+
[2026-06-11T22:05:38+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 49 |
+
[2026-06-11T22:05:45+00:00] done decode=32 chunk=4
|
| 50 |
+
[2026-06-11T22:05:45+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 51 |
+
[2026-06-11T22:05:52+00:00] done decode=32 chunk=5
|
| 52 |
+
[2026-06-11T22:05:52+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 53 |
+
[2026-06-11T22:05:58+00:00] done decode=32 chunk=6
|
| 54 |
+
[2026-06-11T22:05:58+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 55 |
+
[2026-06-11T22:06:05+00:00] done decode=32 chunk=7
|
| 56 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p8_s1p2_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 57 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 58 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 59 |
+
sc1p0 raw_full 21.52620400509214 4.8917594261110695 0.06594349451492308 0.41825118359967517 0.02996874425445854 63 63 62448 65268 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p8_s1p2_sc1p0_decode32_n64/sc1p0
|
| 60 |
+
sc1p0 pre_eos 25.060444095034285 4.919467934444053 0.0680326961691094 0.43153933721224386 0.02989770589258328 0 0 58379 63249 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p8_s1p2_sc1p0_decode32_n64/sc1p0
|
| 61 |
+
[2026-06-11T22:06:19+00:00] done
|
| 62 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.8 s=1.2 gamma=0.75 =====
|
| 63 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.8 s=1.3 gamma=0.5 =====
|
| 64 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 65 |
+
use_ema=1
|
| 66 |
+
step=170000
|
| 67 |
+
decode_steps=32
|
| 68 |
+
n=64 chunk_n=8 gpu=0
|
| 69 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 70 |
+
[2026-06-11T22:06:19+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p8_s1p3_sc1p0_decode32_n64
|
| 71 |
+
[2026-06-11T22:06:19+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 72 |
+
[2026-06-11T22:06:27+00:00] done decode=32 chunk=0
|
| 73 |
+
[2026-06-11T22:06:27+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 74 |
+
[2026-06-11T22:06:33+00:00] done decode=32 chunk=1
|
| 75 |
+
[2026-06-11T22:06:33+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 76 |
+
[2026-06-11T22:06:40+00:00] done decode=32 chunk=2
|
| 77 |
+
[2026-06-11T22:06:40+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 78 |
+
[2026-06-11T22:06:47+00:00] done decode=32 chunk=3
|
| 79 |
+
[2026-06-11T22:06:47+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 80 |
+
[2026-06-11T22:06:54+00:00] done decode=32 chunk=4
|
| 81 |
+
[2026-06-11T22:06:54+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 82 |
+
[2026-06-11T22:07:01+00:00] done decode=32 chunk=5
|
| 83 |
+
[2026-06-11T22:07:01+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 84 |
+
[2026-06-11T22:07:07+00:00] done decode=32 chunk=6
|
| 85 |
+
[2026-06-11T22:07:07+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 86 |
+
[2026-06-11T22:07:15+00:00] done decode=32 chunk=7
|
| 87 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p8_s1p3_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 88 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 89 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 90 |
+
sc1p0 raw_full 26.088496424847314 5.042731168338145 0.07950616528470458 0.4614243096458349 0.032111495272771774 63 66 62551 65366 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p8_s1p3_sc1p0_decode32_n64/sc1p0
|
| 91 |
+
sc1p0 pre_eos 30.644222123959185 5.069203592340132 0.08199722257290747 0.47587861189578173 0.03310819340992299 0 0 58519 63368 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p8_s1p3_sc1p0_decode32_n64/sc1p0
|
| 92 |
+
[2026-06-11T22:07:29+00:00] done
|
| 93 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.8 s=1.3 gamma=0.5 =====
|
| 94 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.7 s=1.1 gamma=1.0 =====
|
| 95 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 96 |
+
use_ema=1
|
| 97 |
+
step=170000
|
| 98 |
+
decode_steps=32
|
| 99 |
+
n=64 chunk_n=8 gpu=0
|
| 100 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 101 |
+
[2026-06-11T22:07:29+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p7_s1p1_sc1p0_decode32_n64
|
| 102 |
+
[2026-06-11T22:07:29+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 103 |
+
[2026-06-11T22:07:36+00:00] done decode=32 chunk=0
|
| 104 |
+
[2026-06-11T22:07:36+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 105 |
+
[2026-06-11T22:07:42+00:00] done decode=32 chunk=1
|
| 106 |
+
[2026-06-11T22:07:42+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 107 |
+
[2026-06-11T22:07:49+00:00] done decode=32 chunk=2
|
| 108 |
+
[2026-06-11T22:07:49+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 109 |
+
[2026-06-11T22:07:56+00:00] done decode=32 chunk=3
|
| 110 |
+
[2026-06-11T22:07:56+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 111 |
+
[2026-06-11T22:08:03+00:00] done decode=32 chunk=4
|
| 112 |
+
[2026-06-11T22:08:03+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 113 |
+
[2026-06-11T22:08:10+00:00] done decode=32 chunk=5
|
| 114 |
+
[2026-06-11T22:08:10+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 115 |
+
[2026-06-11T22:08:17+00:00] done decode=32 chunk=6
|
| 116 |
+
[2026-06-11T22:08:17+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 117 |
+
[2026-06-11T22:08:24+00:00] done decode=32 chunk=7
|
| 118 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p7_s1p1_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 119 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 120 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 121 |
+
sc1p0 raw_full 20.59408340293361 4.846067562192244 0.06749465853021197 0.4063268568617806 0.028098436755460598 62 66 60593 65057 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p7_s1p1_sc1p0_decode32_n64/sc1p0
|
| 122 |
+
sc1p0 pre_eos 23.75859126685826 4.865217858440942 0.0695060164661178 0.418436010703146 0.028562381253958203 0 0 56770 63160 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p7_s1p1_sc1p0_decode32_n64/sc1p0
|
| 123 |
+
[2026-06-11T22:08:37+00:00] done
|
| 124 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.7 s=1.1 gamma=1.0 =====
|
| 125 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.7 s=1.2 gamma=0.75 =====
|
| 126 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 127 |
+
use_ema=1
|
| 128 |
+
step=170000
|
| 129 |
+
decode_steps=32
|
| 130 |
+
n=64 chunk_n=8 gpu=0
|
| 131 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 132 |
+
[2026-06-11T22:08:37+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p7_s1p2_sc1p0_decode32_n64
|
| 133 |
+
[2026-06-11T22:08:37+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 134 |
+
[2026-06-11T22:08:44+00:00] done decode=32 chunk=0
|
| 135 |
+
[2026-06-11T22:08:44+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 136 |
+
[2026-06-11T22:08:51+00:00] done decode=32 chunk=1
|
| 137 |
+
[2026-06-11T22:08:51+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 138 |
+
[2026-06-11T22:08:57+00:00] done decode=32 chunk=2
|
| 139 |
+
[2026-06-11T22:08:57+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 140 |
+
[2026-06-11T22:09:04+00:00] done decode=32 chunk=3
|
| 141 |
+
[2026-06-11T22:09:04+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 142 |
+
[2026-06-11T22:09:11+00:00] done decode=32 chunk=4
|
| 143 |
+
[2026-06-11T22:09:11+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 144 |
+
[2026-06-11T22:09:18+00:00] done decode=32 chunk=5
|
| 145 |
+
[2026-06-11T22:09:18+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 146 |
+
[2026-06-11T22:09:25+00:00] done decode=32 chunk=6
|
| 147 |
+
[2026-06-11T22:09:25+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 148 |
+
[2026-06-11T22:09:31+00:00] done decode=32 chunk=7
|
| 149 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p7_s1p2_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 150 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 151 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 152 |
+
sc1p0 raw_full 23.946720952889848 4.957958138393576 0.07400021476015892 0.4454807633306744 0.029161361579407567 62 63 61864 65189 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p7_s1p2_sc1p0_decode32_n64/sc1p0
|
| 153 |
+
sc1p0 pre_eos 27.981779909809337 4.987034399351558 0.07628914900347991 0.45926066530631615 0.029705789307181273 0 0 57898 63220 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p7_s1p2_sc1p0_decode32_n64/sc1p0
|
| 154 |
+
[2026-06-11T22:09:45+00:00] done
|
| 155 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.7 s=1.2 gamma=0.75 =====
|
| 156 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.7 s=1.3 gamma=0.5 =====
|
| 157 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 158 |
+
use_ema=1
|
| 159 |
+
step=170000
|
| 160 |
+
decode_steps=32
|
| 161 |
+
n=64 chunk_n=8 gpu=0
|
| 162 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 163 |
+
[2026-06-11T22:09:45+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p7_s1p3_sc1p0_decode32_n64
|
| 164 |
+
[2026-06-11T22:09:45+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 165 |
+
[2026-06-11T22:09:52+00:00] done decode=32 chunk=0
|
| 166 |
+
[2026-06-11T22:09:52+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 167 |
+
[2026-06-11T22:09:59+00:00] done decode=32 chunk=1
|
| 168 |
+
[2026-06-11T22:09:59+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 169 |
+
[2026-06-11T22:10:06+00:00] done decode=32 chunk=2
|
| 170 |
+
[2026-06-11T22:10:06+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 171 |
+
[2026-06-11T22:10:13+00:00] done decode=32 chunk=3
|
| 172 |
+
[2026-06-11T22:10:13+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 173 |
+
[2026-06-11T22:10:19+00:00] done decode=32 chunk=4
|
| 174 |
+
[2026-06-11T22:10:19+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 175 |
+
[2026-06-11T22:10:26+00:00] done decode=32 chunk=5
|
| 176 |
+
[2026-06-11T22:10:26+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 177 |
+
[2026-06-11T22:10:33+00:00] done decode=32 chunk=6
|
| 178 |
+
[2026-06-11T22:10:33+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 179 |
+
[2026-06-11T22:10:40+00:00] done decode=32 chunk=7
|
| 180 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p7_s1p3_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 181 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 182 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 183 |
+
sc1p0 raw_full 27.422054592056327 5.041867318617414 0.08125612444879961 0.47679563932568786 0.032275845173934344 61 65 62012 65312 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p7_s1p3_sc1p0_decode32_n64/sc1p0
|
| 184 |
+
sc1p0 pre_eos 32.913115722054194 5.078337786263495 0.08398746597455213 0.4927754126639973 0.03266442995505476 0 0 57737 63188 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p7_s1p3_sc1p0_decode32_n64/sc1p0
|
| 185 |
+
[2026-06-11T22:10:54+00:00] done
|
| 186 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.7 s=1.3 gamma=0.5 =====
|
| 187 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.6 s=1.1 gamma=1.0 =====
|
| 188 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 189 |
+
use_ema=1
|
| 190 |
+
step=170000
|
| 191 |
+
decode_steps=32
|
| 192 |
+
n=64 chunk_n=8 gpu=0
|
| 193 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 194 |
+
[2026-06-11T22:10:54+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p6_s1p1_sc1p0_decode32_n64
|
| 195 |
+
[2026-06-11T22:10:54+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 196 |
+
[2026-06-11T22:11:01+00:00] done decode=32 chunk=0
|
| 197 |
+
[2026-06-11T22:11:01+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 198 |
+
[2026-06-11T22:11:07+00:00] done decode=32 chunk=1
|
| 199 |
+
[2026-06-11T22:11:07+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 200 |
+
[2026-06-11T22:11:15+00:00] done decode=32 chunk=2
|
| 201 |
+
[2026-06-11T22:11:15+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 202 |
+
[2026-06-11T22:11:22+00:00] done decode=32 chunk=3
|
| 203 |
+
[2026-06-11T22:11:22+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 204 |
+
[2026-06-11T22:11:29+00:00] done decode=32 chunk=4
|
| 205 |
+
[2026-06-11T22:11:29+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 206 |
+
[2026-06-11T22:11:35+00:00] done decode=32 chunk=5
|
| 207 |
+
[2026-06-11T22:11:35+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 208 |
+
[2026-06-11T22:11:42+00:00] done decode=32 chunk=6
|
| 209 |
+
[2026-06-11T22:11:42+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 210 |
+
[2026-06-11T22:11:49+00:00] done decode=32 chunk=7
|
| 211 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p6_s1p1_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 212 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 213 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 214 |
+
sc1p0 raw_full 21.50305654081071 4.852759815725825 0.0717684927076435 0.42474973047897735 0.028353174908749286 62 64 60466 64931 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p6_s1p1_sc1p0_decode32_n64/sc1p0
|
| 215 |
+
sc1p0 pre_eos 24.970190318349992 4.874398193301189 0.07392187351251864 0.4375247917493058 0.0283533779709961 0 0 56619 63026 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p6_s1p1_sc1p0_decode32_n64/sc1p0
|
| 216 |
+
[2026-06-11T22:12:02+00:00] done
|
| 217 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.6 s=1.1 gamma=1.0 =====
|
| 218 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.6 s=1.2 gamma=0.75 =====
|
| 219 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 220 |
+
use_ema=1
|
| 221 |
+
step=170000
|
| 222 |
+
decode_steps=32
|
| 223 |
+
n=64 chunk_n=8 gpu=0
|
| 224 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 225 |
+
[2026-06-11T22:12:02+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p6_s1p2_sc1p0_decode32_n64
|
| 226 |
+
[2026-06-11T22:12:02+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 227 |
+
[2026-06-11T22:12:09+00:00] done decode=32 chunk=0
|
| 228 |
+
[2026-06-11T22:12:09+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 229 |
+
[2026-06-11T22:12:16+00:00] done decode=32 chunk=1
|
| 230 |
+
[2026-06-11T22:12:16+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 231 |
+
[2026-06-11T22:12:23+00:00] done decode=32 chunk=2
|
| 232 |
+
[2026-06-11T22:12:23+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 233 |
+
[2026-06-11T22:12:30+00:00] done decode=32 chunk=3
|
| 234 |
+
[2026-06-11T22:12:30+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 235 |
+
[2026-06-11T22:12:37+00:00] done decode=32 chunk=4
|
| 236 |
+
[2026-06-11T22:12:37+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 237 |
+
[2026-06-11T22:12:44+00:00] done decode=32 chunk=5
|
| 238 |
+
[2026-06-11T22:12:44+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 239 |
+
[2026-06-11T22:12:51+00:00] done decode=32 chunk=6
|
| 240 |
+
[2026-06-11T22:12:51+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 241 |
+
[2026-06-11T22:12:57+00:00] done decode=32 chunk=7
|
| 242 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p6_s1p2_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 243 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 244 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 245 |
+
sc1p0 raw_full 25.659964647184964 4.985343735014883 0.0802381975566333 0.46383239966234363 0.029682607894898398 61 63 61533 65156 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p6_s1p2_sc1p0_decode32_n64/sc1p0
|
| 246 |
+
sc1p0 pre_eos 30.360652096600177 5.017444367862489 0.08275676445908076 0.47838822039265355 0.030620161175408875 0 0 57514 63161 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p6_s1p2_sc1p0_decode32_n64/sc1p0
|
| 247 |
+
[2026-06-11T22:13:11+00:00] done
|
| 248 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.6 s=1.2 gamma=0.75 =====
|
| 249 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.6 s=1.3 gamma=0.5 =====
|
| 250 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 251 |
+
use_ema=1
|
| 252 |
+
step=170000
|
| 253 |
+
decode_steps=32
|
| 254 |
+
n=64 chunk_n=8 gpu=0
|
| 255 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 256 |
+
[2026-06-11T22:13:11+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p6_s1p3_sc1p0_decode32_n64
|
| 257 |
+
[2026-06-11T22:13:11+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 258 |
+
[2026-06-11T22:13:18+00:00] done decode=32 chunk=0
|
| 259 |
+
[2026-06-11T22:13:18+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 260 |
+
[2026-06-11T22:13:25+00:00] done decode=32 chunk=1
|
| 261 |
+
[2026-06-11T22:13:25+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 262 |
+
[2026-06-11T22:13:32+00:00] done decode=32 chunk=2
|
| 263 |
+
[2026-06-11T22:13:32+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 264 |
+
[2026-06-11T22:13:39+00:00] done decode=32 chunk=3
|
| 265 |
+
[2026-06-11T22:13:39+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 266 |
+
[2026-06-11T22:13:46+00:00] done decode=32 chunk=4
|
| 267 |
+
[2026-06-11T22:13:46+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 268 |
+
[2026-06-11T22:13:52+00:00] done decode=32 chunk=5
|
| 269 |
+
[2026-06-11T22:13:52+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 270 |
+
[2026-06-11T22:13:59+00:00] done decode=32 chunk=6
|
| 271 |
+
[2026-06-11T22:13:59+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 272 |
+
[2026-06-11T22:14:06+00:00] done decode=32 chunk=7
|
| 273 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p6_s1p3_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 274 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 275 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 276 |
+
sc1p0 raw_full 28.52182894995212 5.101615840032061 0.08837915331421825 0.4943573859977307 0.03224520461828608 62 63 62157 65219 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p6_s1p3_sc1p0_decode32_n64/sc1p0
|
| 277 |
+
sc1p0 pre_eos 34.46300939980163 5.1416954886637285 0.09140074858846667 0.5112527953561403 0.03257628623992895 0 0 57789 63052 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p6_s1p3_sc1p0_decode32_n64/sc1p0
|
| 278 |
+
[2026-06-11T22:14:20+00:00] done
|
| 279 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.6 s=1.3 gamma=0.5 =====
|
| 280 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.5 s=1.1 gamma=1.0 =====
|
| 281 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 282 |
+
use_ema=1
|
| 283 |
+
step=170000
|
| 284 |
+
decode_steps=32
|
| 285 |
+
n=64 chunk_n=8 gpu=0
|
| 286 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 287 |
+
[2026-06-11T22:14:20+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p5_s1p1_sc1p0_decode32_n64
|
| 288 |
+
[2026-06-11T22:14:20+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 289 |
+
[2026-06-11T22:14:27+00:00] done decode=32 chunk=0
|
| 290 |
+
[2026-06-11T22:14:27+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 291 |
+
[2026-06-11T22:14:34+00:00] done decode=32 chunk=1
|
| 292 |
+
[2026-06-11T22:14:34+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 293 |
+
[2026-06-11T22:14:41+00:00] done decode=32 chunk=2
|
| 294 |
+
[2026-06-11T22:14:41+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 295 |
+
[2026-06-11T22:14:48+00:00] done decode=32 chunk=3
|
| 296 |
+
[2026-06-11T22:14:48+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 297 |
+
[2026-06-11T22:14:54+00:00] done decode=32 chunk=4
|
| 298 |
+
[2026-06-11T22:14:54+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 299 |
+
[2026-06-11T22:15:01+00:00] done decode=32 chunk=5
|
| 300 |
+
[2026-06-11T22:15:01+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 301 |
+
[2026-06-11T22:15:08+00:00] done decode=32 chunk=6
|
| 302 |
+
[2026-06-11T22:15:08+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 303 |
+
[2026-06-11T22:15:15+00:00] done decode=32 chunk=7
|
| 304 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p5_s1p1_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 305 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 306 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 307 |
+
sc1p0 raw_full 21.858482352784637 4.791784073302412 0.07351901380306804 0.4287778409702261 0.026883703772018815 61 61 60013 65058 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p5_s1p1_sc1p0_decode32_n64/sc1p0
|
| 308 |
+
sc1p0 pre_eos 25.15321582840132 4.808009201301092 0.07562174896045787 0.4409783708575765 0.026846274249395247 0 0 56357 63249 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_tschedlogit_normal_mn0p5_s1p1_sc1p0_decode32_n64/sc1p0
|
| 309 |
+
[2026-06-11T22:15:28+00:00] done
|
| 310 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.5 s=1.1 gamma=1.0 =====
|
| 311 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.5 s=1.2 gamma=0.75 =====
|
| 312 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 313 |
+
use_ema=1
|
| 314 |
+
step=170000
|
| 315 |
+
decode_steps=32
|
| 316 |
+
n=64 chunk_n=8 gpu=0
|
| 317 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 318 |
+
[2026-06-11T22:15:28+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p5_s1p2_sc1p0_decode32_n64
|
| 319 |
+
[2026-06-11T22:15:28+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 320 |
+
[2026-06-11T22:15:35+00:00] done decode=32 chunk=0
|
| 321 |
+
[2026-06-11T22:15:35+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 322 |
+
[2026-06-11T22:15:42+00:00] done decode=32 chunk=1
|
| 323 |
+
[2026-06-11T22:15:42+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 324 |
+
[2026-06-11T22:15:49+00:00] done decode=32 chunk=2
|
| 325 |
+
[2026-06-11T22:15:49+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 326 |
+
[2026-06-11T22:15:56+00:00] done decode=32 chunk=3
|
| 327 |
+
[2026-06-11T22:15:56+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 328 |
+
[2026-06-11T22:16:03+00:00] done decode=32 chunk=4
|
| 329 |
+
[2026-06-11T22:16:03+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 330 |
+
[2026-06-11T22:16:09+00:00] done decode=32 chunk=5
|
| 331 |
+
[2026-06-11T22:16:09+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 332 |
+
[2026-06-11T22:16:16+00:00] done decode=32 chunk=6
|
| 333 |
+
[2026-06-11T22:16:16+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 334 |
+
[2026-06-11T22:16:23+00:00] done decode=32 chunk=7
|
| 335 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p5_s1p2_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 336 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 337 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 338 |
+
sc1p0 raw_full 25.266168246249908 4.938514322720518 0.0805966484562028 0.46072157512698925 0.0289883985022405 60 65 60865 65164 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p5_s1p2_sc1p0_decode32_n64/sc1p0
|
| 339 |
+
sc1p0 pre_eos 29.701459338708062 4.965520864141782 0.08307755592823467 0.47491495925955224 0.028873841091035662 0 0 56921 63206 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p75_tschedlogit_normal_mn0p5_s1p2_sc1p0_decode32_n64/sc1p0
|
| 340 |
+
[2026-06-11T22:16:37+00:00] done
|
| 341 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.5 s=1.2 gamma=0.75 =====
|
| 342 |
+
===== START \2026-06-11T22:03:43+00:00 gpu=0 m=-0.5 s=1.3 gamma=0.5 =====
|
| 343 |
+
checkpoint=runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr3e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260609_230847/step_170000.pt
|
| 344 |
+
use_ema=1
|
| 345 |
+
step=170000
|
| 346 |
+
decode_steps=32
|
| 347 |
+
n=64 chunk_n=8 gpu=0
|
| 348 |
+
out_base=/e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612
|
| 349 |
+
[2026-06-11T22:16:37+00:00] infer step=170000 decode=32 -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p5_s1p3_sc1p0_decode32_n64
|
| 350 |
+
[2026-06-11T22:16:37+00:00] run decode=32 chunk=0 n=8 seed=123
|
| 351 |
+
[2026-06-11T22:16:44+00:00] done decode=32 chunk=0
|
| 352 |
+
[2026-06-11T22:16:44+00:00] run decode=32 chunk=1 n=8 seed=124
|
| 353 |
+
[2026-06-11T22:16:51+00:00] done decode=32 chunk=1
|
| 354 |
+
[2026-06-11T22:16:51+00:00] run decode=32 chunk=2 n=8 seed=125
|
| 355 |
+
[2026-06-11T22:16:57+00:00] done decode=32 chunk=2
|
| 356 |
+
[2026-06-11T22:16:57+00:00] run decode=32 chunk=3 n=8 seed=126
|
| 357 |
+
[2026-06-11T22:17:04+00:00] done decode=32 chunk=3
|
| 358 |
+
[2026-06-11T22:17:04+00:00] run decode=32 chunk=4 n=8 seed=127
|
| 359 |
+
[2026-06-11T22:17:11+00:00] done decode=32 chunk=4
|
| 360 |
+
[2026-06-11T22:17:11+00:00] run decode=32 chunk=5 n=8 seed=128
|
| 361 |
+
[2026-06-11T22:17:18+00:00] done decode=32 chunk=5
|
| 362 |
+
[2026-06-11T22:17:18+00:00] run decode=32 chunk=6 n=8 seed=129
|
| 363 |
+
[2026-06-11T22:17:25+00:00] done decode=32 chunk=6
|
| 364 |
+
[2026-06-11T22:17:25+00:00] run decode=32 chunk=7 n=8 seed=130
|
| 365 |
+
[2026-06-11T22:17:32+00:00] done decode=32 chunk=7
|
| 366 |
+
merged 64 samples -> /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p5_s1p3_sc1p0_decode32_n64/sc1p0/samples64.txt
|
| 367 |
+
loading scorer /e2e-data/evad-tech-vla/wanghan58/models/flowtext_scorers/gpt2-large-standard dtype=fp32 device=cuda
|
| 368 |
+
run kind ppl mean_entropy distinct_1 distinct_2 top_token_mass eos_rows eos_total ppl_tokens t5_tokens path
|
| 369 |
+
sc1p0 raw_full 29.460939535758925 5.11873864910046 0.09322020896300956 0.5060756697045016 0.03406005001610948 63 65 61814 65179 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p5_s1p3_sc1p0_decode32_n64/sc1p0
|
| 370 |
+
sc1p0 pre_eos 36.21681323635152 5.161349570621279 0.09659108977008936 0.5243985817181562 0.030448055458390307 0 0 57213 62894 /e2e-data/evad-tech-vla/wanghan58/workspace/LTA_openwebtext_dualt/docs/lta_samples/metrics_20260612/owt_t5_not5_bottleneck128_norm_stateprobadd_selfcond_ce_fast_lr3e3_ema0p9999_logitnorm_aggressive_step170000_ema_dgamma0p5_tschedlogit_normal_mn0p5_s1p3_sc1p0_decode32_n64/sc1p0
|
| 371 |
+
[2026-06-11T22:17:45+00:00] done
|
| 372 |
+
===== DONE \2026-06-11T22:03:43+00:00 gpu=0 m=-0.5 s=1.3 gamma=0.5 =====
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_011000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0cd0c96282e23e695a73d59bd884f46e4a424026c4c81a496daf2c7dee9f08dd
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_035000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:61023663970cfea09d8117d0f48ad887f3884f138fe5c9152cd333f13956e8ce
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_048000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd6237b09b1e229df8330ad0378d302f61c2ca77f405c02a56f8969e86d5bfae
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_055000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:65ae57292f163ac54deafaa5be4489c420425aff38c6d4bc8b260543da2c8568
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_076000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e39f52bd4f8eda48bb4e28a6106cb049f52bbc2a4188527fc1e573f427b1ddc0
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_105000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:191dd52e6fb121920624b3ac7acdb36e99d48e1c899e716a965576651987222c
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_128000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:01080c8131573b1dccd2bc2c466e4c7c9488e57b35c423bd343ad66627c50674
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_226000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db855c82987abbb0dac84423153e1e769fd1fe992497893f335aef461fcf0d26
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_227000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:07549e91a7c3c9db9efb07acdd2cd81a46eb96b10a64cd6acdd9e609a8893826
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_256000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:42850b412d7d70134e6613029b967092b3bd301a755dcb041ad8bce2af41467e
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_265000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6e89d549be2dc36ba27e0e06c45ae01243aaf67dbffcf3a516d6910e1bc292f
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_275000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e1a8f205e522871b0feb1b97371cc3c101102509cf2c86b3ef7d19fbbd36ea1e
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_291000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:19982e16df9c6c90648cb45f606c6bd3c42c0da78817f8b5c3210246b2dc910b
|
| 3 |
+
size 927700322
|
LTA_openwebtext_dualt/mini_owt_logdirichlet/runs/owt_t5_elftokenized_full_len1024_C1_to_1024_pow1_d768_l12_h12_gbs512_2x8gpu_50ep_lr4e3_ema0p9999_elfopt_not5_bottleneck128_unfixed_norm_stateprobadd_selfcond_ce_fast_20260610_020108/step_300000.pt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1966d03f2f7b9456051ccd29b8903b4f78dbf02af98681b6e12dd0f3eafe2bf2
|
| 3 |
+
size 927700322
|