Skip to content

Commit

Permalink
Now all constructors are inner constructors.
Browse files Browse the repository at this point in the history
  • Loading branch information
benedict-96 committed Oct 25, 2023
1 parent 2a77845 commit 4070f22
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/data_loader/batch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,12 @@ struct Batch{seq_length}
function Batch(batch_size, seq_length)
new{true}(batch_size, seq_length)

Check warning on line 11 in src/data_loader/batch.jl

View check run for this annotation

Codecov / codecov/patch

src/data_loader/batch.jl#L10-L11

Added lines #L10 - L11 were not covered by tests
end
end

function Batch(batch_size::Integer)
Batch{false}(batch_size, nothing)
function Batch(batch_size::Integer)
new{false}(batch_size, nothing)
end
end

#=
function Batch(batch_size, seq_length)
Batch{true}(batch_size, seq_length)
end
=#

function (batch::Batch{false})(dl::DataLoader{T, AT}) where {T, AT<:AbstractArray{T}}
indices = shuffle(1:dl.n_params)
Expand Down

0 comments on commit 4070f22

Please sign in to comment.