Comments (5)
One option is to build the default functor
on ConstructionBase (which will recurse arrays). Then adopt #41 with a Numeric
tag that applies to numbers and numeric arrays.
from functors.jl.
https://github.com/chengchingwen/StructWalk.jl allows to define customized walks
from functors.jl.
Breaking changes aside, I don't see any major issues with this. Functors.jl is in a weird place because it was designed to be used as part of Flux's module system, yet was written as if it were a generic struct traversal library. The upside is that more libraries outside of FluxML have been able to adopt it, but the downside is confusion from some parts seeming too task-specific (e.g. saying all numeric arrays are leaves) and others seeming too general (how many people know what fmap
means?).
from functors.jl.
Maybe we should allow users to pass their own functor
-like function to fmap
.
We can also provide a set of functor
variations like the aggressive functor proposed here.
from functors.jl.
I would close this as not planned, since people can just handle numerical arrays or use StructWalk.jl instead.
from functors.jl.
Related Issues (20)
- Support ChainRulesCore.Tangent? HOT 9
- Support Base.ComposedFunction HOT 12
- Revisit MacroTools Dependency
- Add more Base types HOT 8
- `fmapreduce`
- Bug in `functor(::Type{NamedTuple}, Any)` HOT 5
- `@functor` for parametric constructors HOT 5
- Taggable functors HOT 4
- Support dictionary
- `@functor` is confused about properties vs fields HOT 5
- Does `functor` have the right semantics for Flux? HOT 6
- empty namedtuple is not a leaf HOT 4
- Recursive inference failure for multiple functors HOT 3
- Warning: Wrapping a custom walk function as an `AnonymousWalk` HOT 7
- fmap API that accepts an arbitrary walk does not use function f HOT 18
- `functor` reconstructs unexpectedly due to the lack of checking NameTuple's keys.
- require walks to always take a KeyPath object as first argument HOT 1
- Add docs previews HOT 2
- `fleaves` should take `walk` as optional argument
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from functors.jl.