-
Notifications
You must be signed in to change notification settings - Fork 282
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable comparison of iterator sampler strategy with str value (#954)
Summary: Pull Request resolved: #954 Reviewed By: mpahsu, JKSenthil Differential Revision: D67550088 fbshipit-source-id: 207b25fde316f9884abcb873fd3c27696efdede5
- Loading branch information
1 parent
ba2fb54
commit ed30bb6
Showing
2 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
# pyre-strict | ||
|
||
import unittest | ||
|
||
from torchtnt.utils.data.iterators import StoppingMechanism | ||
|
||
|
||
class TestIterators(unittest.TestCase): | ||
|
||
def test_stopping_mechanism_comparison(self) -> None: | ||
self.assertTrue( | ||
StoppingMechanism.ALL_DATASETS_EXHAUSTED == "ALL_DATASETS_EXHAUSTED" | ||
) | ||
self.assertTrue( | ||
StoppingMechanism.ALL_DATASETS_EXHAUSTED | ||
== StoppingMechanism.ALL_DATASETS_EXHAUSTED | ||
) | ||
self.assertFalse( | ||
StoppingMechanism.ALL_DATASETS_EXHAUSTED == "SMALLEST_DATASET_EXHAUSTED" | ||
) | ||
self.assertFalse( | ||
StoppingMechanism.ALL_DATASETS_EXHAUSTED | ||
== StoppingMechanism.SMALLEST_DATASET_EXHAUSTED | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters