Skip to content

Commit 6d97138

Browse files
committed
presumably less memory allocations
1 parent 86d0045 commit 6d97138

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/TensorStoreWrapper.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Base.size(w::TensorStoreWrapper) = pyconvert(Tuple, parent(w).shape)
153153
function Base.size(w::TensorStoreWrapper, d::Integer)
154154
d < 1 && throw(ArgumentError("dimension must be ≥ 1"))
155155
di = Base.to_index(d)
156-
return di <= ndims(w) ? size(w)[di] : 1
156+
return d <= ndims(w) ? pyconvert(Int, parent(w).shape[di-1]) : 1
157157
end
158158
Base.ndims(w::TensorStoreWrapper) = pyconvert(Int, parent(w).rank)
159159

@@ -236,7 +236,7 @@ Base.size(w::IndexDomainWrapper) = pyconvert(Tuple, parent(w).shape)
236236
function Base.size(w::IndexDomainWrapper, d::Integer)
237237
d < 1 && throw(ArgumentError("dimension must be ≥ 1"))
238238
di = Base.to_index(d)
239-
return d <= ndims(w) ? size(w)[di] : 1
239+
return d <= ndims(w) ? pyconvert(Int, parent(w).shape[di-1]) : 1
240240
end
241241
Base.ndims(w::IndexDomainWrapper) = pyconvert(Int, parent(w).rank)
242242
function Base.axes(w::IndexDomainWrapper)

0 commit comments

Comments
 (0)