-
Notifications
You must be signed in to change notification settings - Fork 18
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
Shouldn't Tensor, Matrix and Vector share more code? #24
Comments
I think you're absolutely right! These should totally be refactored to adopt a common protocol. Thoughts on a protocol name? Something like NDArray or NiftyArray? Not in love with either... And I'm happy to have another person interested in the project! It's good to see more people using Swift in Linux. The project has kind of taken a back seat for me the last couple months but I'm stoked to get back on it. |
🤔 The "correct" or "by definition" name would be Tensor, right? Because (I had to mention that idea to be at peace with myself) 😄 Now, leaving it aside... what about calling it |
Haha that is technically correct... Yeah, I actually like TensorProtocol.
That lines up nicely with the fact that Vector and Matrix are just
specializations...
…On Wed, May 24, 2017 at 12:51 PM, Félix Fischer ***@***.***> wrote:
🤔 The "correct" or "by definition" name would be *Tensor,* right?
Because Matrix and Vector are also Tensors. But that, I think, can't be.
Even if we use *protocol extensions* to provide default implementations,
I don't think it's possible to have Tensor be only a protocol and also
use it as a *struct* for Tensor operations.
I had to mention that idea to be at peace with myself 😄
Now, leaving it aside... what about calling it TensorProtocol? Or
TensorBody? Something that describes what's inside :)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#24 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AJSWUW7jtB6FdO_ICyyvJ6c7W6IywOZvks5r9HxHgaJpZM4NkhkE>
.
|
Haha, nice! We're set then :) Want me to start a branch and we go from there? |
Yeah, sounds good! I've been working on some stuff in a separate project that I need to clean up and integrate here (some pandas type stuff and the beginnings of an optimization toolbox), so that's my main goal now... but if I can be of assistance in any way let me know! |
I can start working on this! (Finally) Now I’m back! I think the protocol (and subsequent refactoring) should come first. Right? The tests I think, are easier. But the structs should be fully defined before we improve the tests. Otherwise we would possibly be writing them again 🤔 Sidenote?: I haven’t yet learned what I wanted to learn about Tensors (I was too busy with the exams), so I’ll take it slowly as I learn more. Can I ask you about Tensors as I learn about them? (If you can’t, don’t worry. I have StackExchange as plan B 😊) |
Closing this one, as #29 took its role :D |
When you see T, M and V, they appear to be almost the same thing, if you judge them by their properties:
For better maintainability, shouldn't they share more code? By means of a protocol, for example. This would help with not only maintenance, it would also help with testing and functions by joining together test cases and functions that are basically the same across types (see the
mean
function for example).Btw, I like this project because it actually works in Linux 😄 I wanna help with this in my spare time
The text was updated successfully, but these errors were encountered: