Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Have SDVariable use Kotlin operator method names #7367
SDVariable has quite a few methods that Kotlin will provide operators for if named correctly, like the plus, multiply, ect. However, most of them are named wrong to automatically have operators.
We can either change the names or create overloads. Imo changing is cleaner, although it will break stuff.
Can make a PR if/when the best way to do it is decided.
Yeah, I'm opposed to renaming them, as we want SDVariable to match INDArray as much as possible to minimize the learning/switching costs. Plus breaking API changes are something we try to avoid unless there's a very good reason (and I'm not sure this is good enough).
The overload idea would work: so keep SDVariable.add, but introduce an SDVariable.plus method that is an alias - i.e., just calls add internally.
No, I'm opposed to deprecating add etc, for the same reassons I outlined earlier. Unless we change INDArray to match (and we're not doing that) it just creates additional cognitive load for most users, just so Kotlin users can have a slightly easier time. :)
Edit: and I agree it adds clutter. But I think that's the lesser of the evils here.