Skip to content

Commit 911282d

Browse files
mkittiCopilot
andauthored
Update src/TensorStoreWrapper.jl
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 6e58653 commit 911282d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/TensorStoreWrapper.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,9 @@ end
236236
Base.size(w::IndexDomainWrapper) = pyconvert(Tuple, parent(w).shape)
237237
function Base.size(w::IndexDomainWrapper, d::Integer)
238238
d < 1 && throw(ArgumentError("dimension must be ≥ 1"))
239+
d > ndims(w) && return 1
239240
di = Base.to_index(d)
240-
return d <= ndims(w) ? pyconvert(Int, parent(w).shape[di-1]) : 1
241+
return pyconvert(Int, parent(w).shape[di-1])
241242
end
242243
Base.ndims(w::IndexDomainWrapper) = pyconvert(Int, parent(w).rank)
243244
function Base.axes(w::IndexDomainWrapper)

0 commit comments

Comments
 (0)