Skip to content

Commit

Permalink
Ignore warning that is only produced when calling with an abnormally …
Browse files Browse the repository at this point in the history
…small tensor size
  • Loading branch information
dagardner-nv committed Jan 12, 2024
1 parent b4b1df2 commit d88d5ef
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/dfencoder/test_scalers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import warnings

import numpy as np
import pytest
import torch
Expand Down Expand Up @@ -48,8 +50,14 @@ def modified_scaler(fit_tensor):
@pytest.fixture(scope="function")
def gauss_rank_scaler(fit_tensor):
scaler = scalers.GaussRankScaler()
scaler.fit(fit_tensor)
yield scaler

with warnings.catch_warnings():
# This warning is triggered by the abnormally small tensor size used in this test
warnings.filterwarnings("ignore",
message=r"n_quantiles \(1000\) is greater than the total number of samples \(3\).*",
category=UserWarning)
scaler.fit(fit_tensor)
yield scaler


def test_ensure_float_type():
Expand Down

0 comments on commit d88d5ef

Please sign in to comment.