Skip to content

Commit 2a59413

Browse files
authored
sync (#58)
1 parent 2f2902c commit 2a59413

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

torchstore/utils.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@
44
# This source code is licensed under the BSD-style license found in the
55
# LICENSE file in the root directory of this source tree.
66

7+
import math
78
import uuid
89
from logging import getLogger
910
from typing import List, Tuple, TYPE_CHECKING
1011

11-
import numpy as np
12-
1312
import torch
1413

1514
from torchstore.constants import MONARCH_HOSTMESH_V1
@@ -119,8 +118,8 @@ def get_target_tensor_shape_and_offset(
119118

120119
# Verify that local tensors can fill the target tensor, this verification is only necessary but not
121120
# sufficient to guarantee that the target tensor can be filled by local tensors.
122-
local_tensor_total_size = sum([np.prod(shape) for shape in local_tensor_shapes])
123-
target_tensor_size = np.prod(target_shape)
121+
local_tensor_total_size = sum([math.prod(shape) for shape in local_tensor_shapes])
122+
target_tensor_size = math.prod(target_shape)
124123
assert (
125124
local_tensor_total_size >= target_tensor_size
126125
), "Local tensor sizes doesn't match target tensor. "

0 commit comments

Comments
 (0)