Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Cartesian Embedding methods #670

Merged
merged 3 commits into from
Jun 1, 2024
Merged

Add Cartesian Embedding methods #670

merged 3 commits into from
Jun 1, 2024

Conversation

ldeso
Copy link
Contributor

@ldeso ldeso commented May 29, 2024

This is an alternative to #668 that adds Cartesian indexing methods to the existing Embedding layer instead of creating a new CartesianEmbedding layer.

Note that this modifies the Embedding composite type from:

struct Embedding <: AbstractExplicitLayer
    in_dims::Int
    out_dims::Int
    init_weight
end

to:

struct Embedding{N} <: AbstractExplicitLayer
    in_dims::NTuple{N, Int}
    out_dims::Int
    init_weight
end

Closes #668.

@ldeso
Copy link
Contributor Author

ldeso commented May 29, 2024

Force-pushed because I forgot to capitalize the word "Cartesian" in the documentation.

src/layers/basic.jl Outdated Show resolved Hide resolved
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.

Thanks for the contribution!

@avik-pal avik-pal merged commit ca23485 into LuxDL:main Jun 1, 2024
59 of 62 checks passed
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