Skip to content

Commit

Permalink
Merge pull request #533 from LuxDL/ap/explicit_imports
Browse files Browse the repository at this point in the history
Test for implicit imports
  • Loading branch information
avik-pal authored Mar 23, 2024
2 parents e1f9ba9 + 62eafce commit e571780
Show file tree
Hide file tree
Showing 23 changed files with 159 additions and 113 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
version: ['1.10']
version: ['1']
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
Expand Down
7 changes: 5 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ComponentArrays = "0.15.11"
ConcreteStructs = "0.2.3"
ConstructionBase = "1.5"
FastClosures = "0.3.2"
ExplicitImports = "1.1.1"
Flux = "0.14.11"
Functors = "0.4.4"
GPUArraysCore = "0.1.6"
Expand All @@ -68,7 +69,7 @@ Logging = "1.10"
LuxAMDGPU = "0.2.2"
LuxCUDA = "0.3.2"
LuxCore = "0.1.12"
LuxDeviceUtils = "0.1.15"
LuxDeviceUtils = "0.1.16"
LuxLib = "0.3.10"
LuxTestUtils = "0.1.15"
MacroTools = "0.5.13"
Expand All @@ -94,8 +95,10 @@ julia = "1.10"
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2"
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
ComponentArrays = "b0b7db55-cfe3-40fc-9ded-d10e2dbeff66"
ExplicitImports = "7d51a73a-1435-4ff3-83d9-f097790105c7"
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
Functors = "d9f16b24-f501-4c13-a1f2-28368ffc5196"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
Expand All @@ -119,4 +122,4 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"

[targets]
test = ["ADTypes", "Adapt", "Aqua", "ChainRulesCore", "ComponentArrays", "Flux", "Functors", "Logging", "LuxAMDGPU", "LuxCUDA", "LuxCore", "LuxLib", "LuxTestUtils", "Optimisers", "Random", "ReTestItems", "Reexport", "ReverseDiff", "Setfield", "SimpleChains", "StableRNGs", "Statistics", "Test", "Tracker", "Zygote"]
test = ["ADTypes", "Adapt", "Aqua", "ChainRules", "ChainRulesCore", "ComponentArrays", "ExplicitImports", "Flux", "Functors", "Logging", "LuxAMDGPU", "LuxCUDA", "LuxCore", "LuxLib", "LuxTestUtils", "Optimisers", "Random", "ReTestItems", "Reexport", "ReverseDiff", "Setfield", "SimpleChains", "StableRNGs", "Statistics", "Test", "Tracker", "Zygote"]
5 changes: 3 additions & 2 deletions docs/src/introduction/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

## Installation

Install [Julia v1.10 or above](https://julialang.org/downloads/). Lux.jl is available through
the Julia package manager. You can enter it by pressing `]` in the REPL and then typing
Install [Julia v1.10 or above](https://julialang.org/downloads/). Lux.jl is available
through the Julia package manager. You can enter it by pressing `]` in the REPL and then
typing

```julia
pkg> add Lux
Expand Down
2 changes: 1 addition & 1 deletion ext/LuxChainRulesExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module LuxChainRulesExt

using ChainRules, ChainRulesCore, Lux
using ChainRules: ChainRules

# https://github.com/FluxML/Zygote.jl/pull/1328 broke the RNNs completely. Putting an
# emergency patch here
Expand Down
3 changes: 2 additions & 1 deletion ext/LuxComponentArraysExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module LuxComponentArraysExt

using ComponentArrays, Lux
using ComponentArrays: ComponentArrays, ComponentArray, FlatAxis
using Lux: Lux

# Empty NamedTuple: Hack to avoid breaking precompilation
function ComponentArrays.ComponentArray(data::Vector{Any}, axes::Tuple{FlatAxis})
Expand Down
7 changes: 4 additions & 3 deletions ext/LuxComponentArraysReverseDiffExt.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
module LuxComponentArraysReverseDiffExt

using ComponentArrays, ReverseDiff, Lux
using ComponentArrays: ComponentArray
using Lux: Lux
using ReverseDiff: TrackedArray

const TCA{V, D, N, DA, A, Ax} = ReverseDiff.TrackedArray{
V, D, N, ComponentArray{V, N, A, Ax}, DA}
const TCA{V, D, N, DA, A, Ax} = TrackedArray{V, D, N, ComponentArray{V, N, A, Ax}, DA}

Lux.__named_tuple(x::TCA) = NamedTuple(x)

Expand Down
Loading

0 comments on commit e571780

Please sign in to comment.