-
Notifications
You must be signed in to change notification settings - Fork 137
Conversation
Add space between colon and protocol name. Co-Authored-By: Richard Wei <[email protected]>
Correct misspelling. Co-Authored-By: Richard Wei <[email protected]>
Remove unneeded line break in documentation. Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
Yep, the Swift for TensorFlow team plans to implement default generic arguments at some point if it's not yet done by the Swift community. |
Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
Co-Authored-By: Richard Wei <[email protected]>
… into layer/embedding
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great. Thanks for putting this together!
@rxwei Glad to help out! Sorry for all the tiny mistakes. I'll be much more careful on any future PRs I submit. |
@frozen | ||
public struct EmbeddingInput: Differentiable { | ||
/// Sequences of indices that will be passed into the layer. | ||
@noDerivative public var indices: Tensor<Int32> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's absolutely possible to have an embedding layer with more than 2^32 embeddings (and therefore one that requires Int64
indices), but it's fine to not worry about that for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gathering(atIndices:alongAxis:)
is not yet generic over BinaryInteger
. To fix this, we need to start from there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add support for embeddings.
#54
It might be a good idea to find a type alias for this layer to avoid having to supply a useless generic type argument, e.g.
Embedding<Float>
, since aTensorFlowFloatingPoint
is not the true type (Int
) of input into the layer. Maybe Swift will soon implement default generic parameters?