Skip to content

Commit 15c7c00

Browse files
fixing miscellaneous typos in different files (#77)
1 parent bd566d8 commit 15c7c00

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/datasets/utils/video/transforms.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ class RandomResize(object):
831831
Args:
832832
interpolation (str): Can be one of 'nearest', 'bilinear'
833833
defaults to nearest
834-
size (tuple): (widht, height)
834+
size (tuple): (width, height)
835835
"""
836836

837837
def __init__(self, ratio=(3.0 / 4.0, 4.0 / 3.0), interpolation="nearest"):
@@ -860,7 +860,7 @@ class Resize(object):
860860
Args:
861861
interpolation (str): Can be one of 'nearest', 'bilinear'
862862
defaults to nearest
863-
size (tuple): (widht, height)
863+
size (tuple): (width, height)
864864
"""
865865

866866
def __init__(self, size, interpolation="nearest"):
@@ -1138,7 +1138,7 @@ class Normalize(object):
11381138
will normalize each channel of the input ``torch.*Tensor`` i.e.
11391139
``input[channel] = (input[channel] - mean[channel]) / std[channel]``
11401140
.. note::
1141-
This transform acts out of place, i.e., it does not mutates the input tensor.
1141+
This transform acts out of place, i.e., it does not mutate the input tensor.
11421142
Args:
11431143
mean (sequence): Sequence of means for each channel.
11441144
std (sequence): Sequence of standard deviations for each channel.

src/datasets/utils/weighted_sampler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,15 @@ def __next__(self) -> int:
153153
# then rank 0 will ONLY sample from [0, 2, 4, 6, 8], and rank 1 from [1, 3, 5, 7, 9].
154154
# In each iteration we first produce `in_rank_sample` which is the sample index in the rank,
155155
# based on the size of the subset which that rank can sample from.
156-
# Then we computer `sample_idx_in_dataset` for the indx of the sample in the whole dataset.
156+
# Then we compute `sample_idx_in_dataset` for the index of the sample in the whole dataset.
157157
# For the above example if we are sampling for rank 1, we have `self.rng.integers(5)`.
158158
# Let's assume the result is 2, then `in_rank_sample` is 2 (number "5" in the subset),
159159
# so the sample index in the whole dataset is
160160
# `in_rank_sample * self.num_replicas + self.rank`: 2 * 2 + 1 = 5.
161161

162162
selected_dataset_size = self.dataset_sizes[selected_dataset_idx]
163163
# 1) Getting sample index in the rank.
164-
# NOTE: this may effectively drops the last batch,
164+
# NOTE: this may effectively drop the last batch,
165165
# but given the sample sizes that we use this sampler with, it should not be an issue.
166166
num_samples_in_rank = selected_dataset_size // self.num_replicas
167167
in_rank_sample = self.rng.integers(num_samples_in_rank)
@@ -260,7 +260,7 @@ def __init__(
260260
self.individual_dataset_sampler = []
261261
for ids, ds in enumerate(self.dataset_sizes):
262262

263-
# NOTE: this may effectively drops the last batch,
263+
# NOTE: this may effectively drop the last batch,
264264
# but given the sample sizes that we use this sampler with, it should not be an issue.
265265
num_samples_in_rank = ds // self.num_replicas
266266
self.individual_dataset_sampler.append(self._new_sampler(num_samples_in_rank))

tests/datasets/test_vjepa_transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def setUp(self):
1919
self.g = torch.Generator()
2020
self.g.manual_seed(42)
2121

22-
def test_approximation_equivalance(self):
22+
def test_approximation_equivalence(self):
2323
T, H, W, C = 16, 224, 224, 3
2424
shape = (T, H, W, C)
2525
mean = torch.tensor([0.485, 0.456, 0.406])

0 commit comments

Comments
 (0)