simplify _getobs
This commit is contained in:
parent
75692161a7
commit
cb34bb848b
|
@ -104,10 +104,7 @@ function _nobs(data::Union{Tuple, NamedTuple})
|
||||||
return n
|
return n
|
||||||
end
|
end
|
||||||
|
|
||||||
function _getobs(data::AbstractArray{T,N}, i) where {T,N}
|
_getobs(data::AbstractArray, i) = selectdim(data, ndims(data), i)
|
||||||
getindex(data, ntuple(i->Colon(), Val(N-1))..., i)
|
|
||||||
end
|
|
||||||
|
|
||||||
_getobs(data::Union{Tuple, NamedTuple}, i) = map(x -> _getobs(x, i), data)
|
_getobs(data::Union{Tuple, NamedTuple}, i) = map(x -> _getobs(x, i), data)
|
||||||
|
|
||||||
Base.eltype(d::DataLoader{D}) where D = D
|
Base.eltype(d::DataLoader{D}) where D = D
|
||||||
|
|
Loading…
Reference in New Issue