JuliaDiff / JuliaDiff/ChainRules.jl

Remove `@non_differentiable` for `trunc`?

Open
#649 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
475
Forks
98
PR merge metrics
No merged PRs in 30d

Description

I saw that the @non_differentiable tag was removed for floor, ceil, and round recently (https://github.com/JuliaDiff/ChainRules.jl/commit/1770bb29ca42d4e07643284e0a4917ad6ea35b57). Should the same thing be done for trunc?

https://github.com/JuliaDiff/ChainRules.jl/blob/7faaf5d540e1249e6b2087c1d52cbef4b85c58e8/src/rulesets/Base/nondiff.jl#L433

I am trying to take the gradient of a function that returns an index, so maybe I'm thinking about this the wrong way anyways.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/rulesets/Base/nondiff.jl around line 433 and compare the linked commit that removed the tag from floor, ceil, and round. Determine whether trunc should follow the same treatment, considering the indexing use case; the issue is resolved when the intended behavior is decided and the relevant rule and coverage are updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.