Implement the Abs function for IntTensor on the CPU
As a Data Scientist using PySyft's IntTensor type, I want to leverage a wide range of methods which use our new Unity backend. For this ticket to be complete, the abs() should be added to our IntTensor class with the appropriate functionality, returning a new tensor.
If you want to take it to the next level, boost it implementing the operation on the GPU: Search for an issue titled like this but with "on the GPU" on the title! HLSL (GPU language) tutorial here: Direct Compute Programming Guide
Note, it is possible that when you look in the code you'll find that parts of this issue were completed on the backend while implementing another issue. This is normal as features do not live in isolation. If this is the case, just take it as a convenience that someone already built that part and press on!
Every Reference You Might Need for this Issue:
- For a reference on the operation this performs check out PyTorch's documentation.
- For a reference on how to program in Unity, check out this basic tutorial
- For a reference on how to write HLSL code, check out this basic tutorial
- For a complete tutorial on how to add functions to FloatTensor (step by step guide) see this Google Document
- For a reference on how other functions like this have been implemented check out the functions in this notebook as well as the corresponding files that made it possible (SyftController, FloatTensor.Ops, FloatTensorShaders, TensorOpsShaders, FloatTensorTest and FloatTensorGpuTest).
- And of course, please consider our Contributor Guidelines for all contributions.
Acceptance Criteria:
- [ ] comment below that you're picking up this project
- [ ] an example in a notebook in our tests folder showing how to use the functionality from PySyft
- [ ] an integration test in PySyft demonstrating the correct CPU operation implemented over an IntTensor while connected to a Unity backend
- [ ] a Unit Test in OpenMined/OpenMined demonstrating the correct operation on a FloatTensor
- [ ] inline documentation in the python code. For inspiration on inline documentation, please check out PyTorch's documentation for this operator.
- [ ] Link your Pull Request back to this Issue so that it gets closed appropriately when the PR is merged.
I'll take a look at this