Skip to content

Conversation

@rayegun
Copy link

@rayegun rayegun commented Apr 30, 2021

Hopefully I did this right, git-fu is WIP. This is based on PR #405, don't think I did that right... Are dependent PRs possible in GitHub?

@oxinabox oxinabox changed the title Add frules and tests Add repeat frules and tests May 2, 2021
Comment on lines +144 to +154
function frule((_, Δx), ::typeof(repeat), x, m::Integer)
return repeat(x, m), repeat(Δx, m)
end

function frule((_, Δxs), ::typeof(repeat), xs; inner=ntuple(_->1, ndims(xs)), outer=ntuple(_->1, ndims(xs)))
return repeat(xs; inner=inner, outer=outer), repeat(Δxs; inner=inner, outer=outer)
end

function frule((_, Δx), ::typeof(repeat), x::AbstractArray{<:Real,0}, m::Integer)
return repeat(x, m), repeat(fill(Δx,m))
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the rules not covered by #460, which only did rrules. PR could be rebased to still add these.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will take a look at this around Wednesday this week after finishing my late JuliaCon vid. Sorry I lost track of them

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No rush, was just closing stale PRs & thought this one should get a note for whenever someone looks.

@mcabbott mcabbott mentioned this pull request Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants