Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Define isleaf #84

Merged
merged 9 commits into from
Oct 19, 2024
Merged

Define isleaf #84

merged 9 commits into from
Oct 19, 2024

Conversation

CarloLucibello
Copy link
Contributor

@CarloLucibello CarloLucibello commented Oct 16, 2024

In order to allow for customized data movement for custom types we give the possibility to hook into the data transfer mechanism by implementing

MLDataDevices.isleaf(x::MyType) = true
Adapt.adapt_structure(device::CUDADevice, x::MyType) = ...  

See
FluxML/Flux.jl#2498 (comment)
and the discussion in that PR.

TODO

  • tests
  • docs

@CarloLucibello
Copy link
Contributor Author

@avik-pal could you give me feedback if I should finish this PR or if you prefer another approach?

Copy link
Member

@avik-pal avik-pal left a comment

Choose a reason for hiding this comment

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

overall looks good.

src/MLDataDevices.jl Outdated Show resolved Hide resolved
src/public.jl Outdated Show resolved Hide resolved
@CarloLucibello
Copy link
Contributor Author

done

Project.toml Outdated Show resolved Hide resolved
@avik-pal avik-pal merged commit aafe493 into LuxDL:main Oct 19, 2024
25 of 29 checks passed
avik-pal pushed a commit that referenced this pull request Oct 19, 2024
* isleaf

* exclude

* add tests and docs

* more tests

* import functors

* fix test

* chore: reduce min compat

* chore: run formatter

* chore: bump version for release
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants