codecov[bot]: # [Codecov](https://codecov.io/gh/OpenMined/PySyft/pull/396?src=pr&el=h1) Report
> Merging [#396](https://codecov.io/gh/OpenMined/PySyft/pull/396?src=pr&el=desc) into [master](https://codecov.io/gh/OpenMined/PySyft/commit/7222ce4e3f5ce54ab79f3039be6723a312600a32?src=pr&el=desc) will **decrease** coverage by `0.23%`.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/OpenMined/PySyft/pull/396/graphs/tree.svg?src=pr&token=W0kQS1vaXB&width=650&height=150)](https://codecov.io/gh/OpenMined/PySyft/pull/396?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##           master    #396      +/-   ##
=========================================
- Coverage   99.54%   99.3%   -0.24%     
=========================================
  Files           4       4              
  Lines        1748    1866     +118     
=========================================
+ Hits         1740    1853     +113     
- Misses          8      13       +5
```


| [Impacted Files](https://codecov.io/gh/OpenMined/PySyft/pull/396?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [PySyft/tests/test\_tensor.py](https://codecov.io/gh/OpenMined/PySyft/pull/396?src=pr&el=tree#diff-UHlTeWZ0L3Rlc3RzL3Rlc3RfdGVuc29yLnB5) | `99.05% <0%> (-0.31%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/OpenMined/PySyft/pull/396?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/OpenMined/PySyft/pull/396?src=pr&el=footer). Last update [7222ce4...26f9871](https://codecov.io/gh/OpenMined/PySyft/pull/396?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

diff --git a/syft/tensor.py b/syft/tensor.py
index 3bbdaffd6f..e54015a827 100644
--- a/syft/tensor.py
+++ b/syft/tensor.py
@@ -3095,7 +3095,7 @@ class TensorBase(object):
             return NotImplemented
 
         out = self.data.strides
-        output = tuple(map(lambda x: x / 8, out))
+        output = tuple(map(lambda x: int(x / 8), out))
 
         if dim is None:
             return output
@@ -3481,6 +3481,114 @@ class TensorBase(object):
 
         return TensorBase(np.concatenate(sub_arrays, axis=dim))
 
+    def storage_offset(self):
+        """
+        Returns this tensor’s offset in the underlying
+        storage in terms of number of storage elements (not bytes).
+
+        Parameters
+        ----------
+
+        Returns
+        -------
+        Offset of the underlying storage
+        """
+        if self.encrypted:
+            return NotImplemented
+
+        offset = 0
+
+        # Base ndarray has 0 offset
+        if self.data.base is None:
+            offset = 0
+
+        elif type(self.data.base) is bytes:
+            offset = 0
+
+        else:
+            offset_raw = len(self.data.base.tobytes()) - len(self.data.tobytes())
+            offset = offset_raw / self.data.dtype.itemsize
+
+        return offset
+
+    def set_(self, source=None, offset=0, size=None, stride=None):
+        """
+        Sets the source `numpy.ndarray`, offset, size, and strides.
+
+        If only a tensor is passed in :attr:`source`, this tensor will share
+        the same `numpy.ndarray` and have the same size and strides as the
+        given tensor. Changes to elements in one tensor will be reflected
+        in the other.
+
+        If :attr:`source` is `numpy.ndarray`, the method sets the underlying
+        `numpy.ndarray`, offset, size, and stride.
+
+        Parameters
+        ----------
+
+        source: TensorBase or `numpy.ndarray` or None
+            Input Tensor or ndarray
+
+        offset: int
+            The offset in the underlying `numpy.ndarray` in items not bytes.
+
+        size: Tuple
+            The desired size. Defaults to the size of the source.
+
+        stride: Tuple
+            The desired stride. Defaults to C-contiguous strides.
+        """
+
+        TYPE_ERROR = ''' Received invalid combination of arguments. Expected on of:
+            * no arguments
+            * (syft.TensorBase source)
+            * (np.ndarray storage)
+            * (np.ndarray storage, int offset, tuple size)
+            * (np.ndarray storage, int offset, tuple size, tuple stride)
+        '''
+
+        if self.encrypted or \
+                (source is not None and type(source) is TensorBase and
+                 source.encrypted):
+            return NotImplemented
+
+        # Calling as _set(source=ndarray)
+        if source is not None and \
+            type(source) is np.ndarray and \
+                (offset, size, stride) == (0, None, None):
+            self.data = source
+
+        # Calling as _set(source=ndarray, offset, size)
+        # Calling as _set(source=ndarray, offset, size, stride)
+        elif source is not None and type(source) is np.ndarray \
+                and size is not None:
+
+            _stride = stride
+            if stride is not None:
+                _stride = np.multiply(stride, 8)
+
+            offset_nd = offset * self.data.dtype.itemsize
+            self.data = np.ndarray(shape=size,
+                                   buffer=source.data,
+                                   dtype=self.data.dtype,
+                                   offset=offset_nd,
+                                   strides=_stride)
+
+        # Calling as _set(source=TensorBase)
+        elif source is not None and \
+            type(source) is TensorBase and \
+                (offset, size, stride) == (0, None, None):
+                self.data = source.data
+
+        # Calling as _set()
+        elif (source, offset, size, stride) == (None, 0, None, None):
+            self.data = np.array(None)
+
+        else:
+            raise TypeError(TYPE_ERROR)
+
+        return self
+
     def uniform(self, low=0, high=1):
         """
         Returns a new tensor filled with numbers sampled uniformly

Implement Default set Functionality for Base Tensor Type
**User Story A:** As a Data Scientist using Syft's Base Tensor type, I want to leverage a default method for computing operations on a Tensor of arbitrary type. For this ticket to be complete, set_() should operate inline. For a reference on the operation this performs check out [PyTorch](http://pytorch.org/docs/master/tensors.html)'s documentation.

**Acceptance Criteria:**
- If the Base Tensor type's attribute "encrypted" is set to True, it should return a NotImplemented error.
- a unit test demonstrating the correct operation on the Base Tensor type implemented over int and float Tensors.
- inline documentation in the python code. For inspiration on inline documentation, please check out [PyTorch](http://pytorch.org/docs/master/tensors.html)'s documentation for this operator.
diff --git a/tests/test_tensor.py b/tests/test_tensor.py
index e7296b87c8..58848538ab 100644
--- a/tests/test_tensor.py
+++ b/tests/test_tensor.py
@@ -5,6 +5,7 @@ from syft import tensor
 import numpy as np
 import math
 import pytest
+import struct
 
 
 # Here's our "unit tests".
@@ -20,7 +21,6 @@ class DimTests(unittest.TestCase):
     def test_as_view(self):
         t = TensorBase(np.array([1.0, 2.0, 3.0]))
         t1 = t.view([-1, 1])
-        print(t.data.dtype)
         self.assertTrue(syft.equal(t.view_as(t1), TensorBase(np.array([[1.0], [2.0], [3.0]]))))
 
     def test_resize(self):
@@ -1575,6 +1575,220 @@ class RenormTests(unittest.TestCase):
         self.assertTrue(np.allclose(t, np.array([[1.0, 2.0, 3.0], [2.735054, 3.418817, 4.102581]])))
 
 
+class StorageTests(unittest.TestCase):
+
+    def test_storage_offset(self):
+        # int
+        # create custom buffer
+        data = [7, 4, 5, 5, 8, 2, 1, 1, 4, 3, 9, 4, 9, 9, 3, 1]
+        buf = struct.pack('16i', *data)
+
+        # Use custom buffer and ndarray tensors
+        t1 = TensorBase(np.ndarray(shape=(4, 4), buffer=buf, dtype=np.int32))
+        t2 = TensorBase(np.array([[7, 4, 5, 5],
+                                  [8, 2, 1, 1],
+                                  [4, 3, 9, 4],
+                                  [9, 9, 3, 1]], dtype=np.int32))
+
+        # Test default offset = 0
+        self.assertEqual(t1.storage_offset(), 0)
+        self.assertEqual(t2.storage_offset(), 0)
+
+        # value of first element in first row [7,4,5,5]
+        self.assertEqual(t1[0][0], 7)
+        self.assertEqual(t2[0][0], 7)
+
+        t1.set_(t1.data, offset=8, size=(2, 4))
+        self.assertEqual(t1.storage_offset(), 8)
+        self.assertEqual(t1[0][0], 4)
+
+        t2.set_(t2.data, offset=8, size=(2, 4))
+        self.assertEqual(t2.storage_offset(), 8)
+        self.assertEqual(t2[0][0], 4)
+
+        t1 = TensorBase(np.ndarray(shape=(4, 4), buffer=buf, dtype=np.int32))
+        t1.set_(t1.data, offset=4, size=(3, 4))
+        self.assertEqual(t1.storage_offset(), 4)
+        self.assertEqual(t1[0][0], 8)
+
+        t2 = TensorBase(np.array([[7, 4, 5, 5],
+                                  [8, 2, 1, 1],
+                                  [4, 3, 9, 4],
+                                  [9, 9, 3, 1]], dtype=np.int32))
+        t2.set_(t2.data, offset=4, size=(3, 4))
+        self.assertEqual(t2.storage_offset(), 4)
+        self.assertEqual(t2[0][0], 8)
+
+    def test_storage_offset_encrypted(self):
+        t1 = TensorBase(np.array([1, 2, 4, 4]), encrypted=True)
+        res = t1.storage_offset()
+        self.assertEqual(res, NotImplemented)
+
+    def test_tensor_set_encrypted(self):
+        t1 = TensorBase(np.array([]))
+        t2 = TensorBase(np.array([1, 2, 3, 4]), encrypted=True)
+        res = t1.set_(t2)
+        self.assertEqual(res, NotImplemented)
+
+        res = t2.set_(t1)
+        self.assertEqual(res, NotImplemented)
+
+    def test_tensor_set_source_nd(self):
+        t1 = np.array([1, 2, 3, 4])
+        t2 = np.array([0.1, 0.2, 0.3, 0.4])
+
+        tb = TensorBase([])
+        tb2 = TensorBase([])
+
+        r1 = tb.set_(t1)
+        r2 = tb2.set_(t2)
+
+        self.assertEqual(tb, t1)
+        self.assertEqual(tb2, t2)
+
+        self.assertEqual(r1, t1)
+        self.assertEqual(r2, t2)
+
+    def test_tensor_set_empty(self):
+        t1 = TensorBase([1, 2, 3, 4])
+        t2 = TensorBase([0.1, 0.2, 0.3, 0.4])
+
+        # Tensor with none storage
+        tn = TensorBase([])
+        tn.data = np.array(None)
+
+        # test set_ with no argument
+        result = t1.set_()
+        result_f = t2.set_()
+
+        self.assertEqual(result.data, tn.data)
+        self.assertEqual(result_f.data, tn.data)
+
+    def test_tensor_set_(self):
+        t1 = TensorBase([1, 2, 3, 4])
+        t2 = TensorBase([0.1, 0.2, 0.3, 0.4])
+
+        # test call signature
+        with pytest.raises(TypeError):
+            t1.set_(offset=2)
+            t1.set_(size=2)
+            t1.set_(stride=(1,))
+            t1.set_(offset=2, size=(1,))
+            t1.set_(offset=2, size=(1,), stride=(1,))
+            t1.set_(t2, offset=2, size=(1,), stride=(1,))
+
+        # end test call signature
+
+        # tests on ints
+
+        # begin setting tensor
+
+        t1 = TensorBase([])
+        t2 = TensorBase(np.array([1, 2, 3, 4]))
+        t1.set_(t2)
+
+        # memory location is the same
+        self.assertEqual(t1.data.__array_interface__['data'],
+                         t2.data.__array_interface__['data'])
+
+        # data is the same
+        self.assertTrue((t1.data == t2.data).all())
+        self.assertEqual(t1.data.dtype, np.int)
+
+        # stride and size are the same
+        self.assertEqual(t1.size(), t2.size())
+        self.assertEqual(t1.stride(), t2.stride())
+
+        # end setting tensor
+
+        # begin set offset and size
+
+        t1 = TensorBase([1, 2, 3, 4])
+
+        t1.set_(t1.data, offset=1, size=(3,))
+        self.assertEqual(t1[0], 2)
+        self.assertEqual(t1[2], 4)
+
+        with pytest.raises(IndexError):
+            t1[3]
+
+        # end set offset and size
+
+        # begin set strides
+        t1 = TensorBase([])
+        t2 = TensorBase(np.zeros(shape=(3, 4, 9, 10), dtype=np.int))
+
+        # set strides on new ndarray
+        strides = (10, 360, 90, 1)
+        size = (9, 3, 4, 10)
+        t1.set_(t2.data, 0, size, strides)
+
+        self.assertEqual(t1.data.base.__array_interface__['data'],
+                         t2.data.__array_interface__['data'])
+
+        self.assertEqual(t1.stride(), strides)
+
+        # set strides on underlying ndarray
+        t1 = TensorBase(np.zeros(shape=(3, 4, 9, 10))).uniform_()
+        strides = (10, 360, 90, 1)
+        size = (9, 3, 4, 10)
+
+        t1.set_(t1.data, offset=0, size=size, stride=strides)
+        self.assertEqual(t1.stride(), strides)
+
+        # end set strides
+
+        # tests on floats #######
+
+        # begin setting the underlying ndarray
+
+        t1 = TensorBase([])
+        t2 = TensorBase(np.array([1.0, 2.0, 3.0]))
+        t1.set_(t2)
+        self.assertEqual(t1.data.__array_interface__['data'], t2.data.__array_interface__['data'])
+        self.assertTrue((t1.data == t2.data).all())
+        self.assertEqual(t1.data.dtype, np.float)
+        self.assertEqual(t1.size(), t2.size())
+        self.assertEqual(t1.stride(), t2.stride())
+
+        # end setting the underlying ndarray
+
+        # begin set offset and size
+
+        t2 = TensorBase(np.array([[1.0, 2.0, 3.0], [4.0, 5.0, 6.0]]))
+
+        t2.set_(t2.data, offset=3, size=(3,))
+        self.assertEqual(t2[0], 4.0)
+        self.assertEqual(t2[2], 6.0)
+        with pytest.raises(IndexError):
+            t2[3]
+
+        # end set offset and size
+
+        # begin set strides
+
+        t1 = TensorBase([])
+        shape = (3, 4, 9, 10)
+        t2 = TensorBase(np.zeros(shape=shape, dtype=np.float))
+
+        # set strides on new ndarray
+        strides = (10, 360, 90, 1)
+        size = (9, 3, 4, 10)
+        t1.set_(t2.data, 0, size, strides)
+        self.assertEqual(t1.data.base.__array_interface__['data'],
+                         t2.data.__array_interface__['data'])
+        self.assertEqual(t1.stride(), strides)
+
+        # set strides on underlying ndarray
+        t1 = TensorBase(np.zeros(shape=shape, dtype=np.float))
+        strides = (10, 360, 90, 1)
+        size = (9, 3, 4, 10)
+
+        t1.set_(t1.data, offset=0, size=size, stride=strides)
+        self.assertEqual(t1.stride(), strides)
+        # end set strides
+
+
 class SparseTests(unittest.TestCase):
     def test_sparse(self):
         matrix = TensorBase(np.array([[1, 0], [0, 0]]))

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-flake8
apt-get update apt-get install -y musl-dev g++ libgmp3-dev libmpfr-dev ca-certificates libmpc-dev redis-server
3.6
requirements.txt dev-requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
anyio==3.6.2
argon2-cffi==21.3.0
argon2-cffi-bindings==21.2.0
args==0.1.0
async-generator==1.10
attrs==22.2.0
Babel==2.11.0
backcall==0.2.0
bleach==4.1.0
certifi==2021.5.30
cffi==1.15.1
charset-normalizer==2.0.12
clint==0.5.1
comm==0.1.4
contextvars==2.4
coverage==6.2
dataclasses==0.8
decorator==5.1.1
defusedxml==0.7.1
entrypoints==0.4
flake8==5.0.4
idna==3.10
immutables==0.19
importlib-metadata==4.2.0
iniconfig==1.1.1
ipykernel==5.5.6
ipython==7.16.3
ipython-genutils==0.2.0
ipywidgets==7.8.5
jedi==0.17.2
Jinja2==3.0.3
joblib==1.1.1
json5==0.9.16
jsonschema==3.2.0
jupyter==1.1.1
jupyter-client==7.1.2
jupyter-console==6.4.3
jupyter-core==4.9.2
jupyter-server==1.13.1
jupyterlab==3.2.9
jupyterlab-pygments==0.1.2
jupyterlab-server==2.10.3
jupyterlab_widgets==1.1.11
line-profiler==4.1.3
MarkupSafe==2.0.1
mccabe==0.7.0
mistune==0.8.4
nbclassic==0.3.5
nbclient==0.5.9
nbconvert==6.0.7
nbformat==5.1.3
nest-asyncio==1.6.0
notebook==6.4.10
numpy==1.19.5
packaging==21.3
pandocfilters==1.5.1
parso==0.7.1
pexpect==4.9.0
phe==1.5.0
pickleshare==0.7.5
pluggy==1.0.0
prometheus-client==0.17.1
prompt-toolkit==3.0.36
ptyprocess==0.7.0
py==1.11.0
pycodestyle==2.9.1
pycparser==2.21
pyflakes==2.5.0
Pygments==2.14.0
pyparsing==3.1.4
pyRserve==1.0.4
pyrsistent==0.18.0
pytest==7.0.1
pytest-flake8==1.1.1
python-dateutil==2.9.0.post0
pytz==2025.2
pyzmq==25.1.2
requests==2.27.1
scikit-learn==0.24.2
scipy==1.5.4
Send2Trash==1.8.3
six==1.17.0
sklearn==0.0
sniffio==1.2.0
-e git+https://github.com/OpenMined/PySyft.git@7222ce4e3f5ce54ab79f3039be6723a312600a32#egg=syft
terminado==0.12.1
testpath==0.6.0
threadpoolctl==3.1.0
tomli==1.2.3
tornado==6.1
traitlets==4.3.3
typing_extensions==4.1.1
urllib3==1.26.20
wcwidth==0.2.13
webencodings==0.5.1
websocket-client==1.3.1
widgetsnbextension==3.6.10
zipp==3.6.0

name: PySyft
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - anyio==3.6.2
      - argon2-cffi==21.3.0
      - argon2-cffi-bindings==21.2.0
      - args==0.1.0
      - async-generator==1.10
      - attrs==22.2.0
      - babel==2.11.0
      - backcall==0.2.0
      - bleach==4.1.0
      - cffi==1.15.1
      - charset-normalizer==2.0.12
      - clint==0.5.1
      - comm==0.1.4
      - contextvars==2.4
      - coverage==6.2
      - dataclasses==0.8
      - decorator==5.1.1
      - defusedxml==0.7.1
      - entrypoints==0.4
      - flake8==5.0.4
      - idna==3.10
      - immutables==0.19
      - importlib-metadata==4.2.0
      - iniconfig==1.1.1
      - ipykernel==5.5.6
      - ipython==7.16.3
      - ipython-genutils==0.2.0
      - ipywidgets==7.8.5
      - jedi==0.17.2
      - jinja2==3.0.3
      - joblib==1.1.1
      - json5==0.9.16
      - jsonschema==3.2.0
      - jupyter==1.1.1
      - jupyter-client==7.1.2
      - jupyter-console==6.4.3
      - jupyter-core==4.9.2
      - jupyter-server==1.13.1
      - jupyterlab==3.2.9
      - jupyterlab-pygments==0.1.2
      - jupyterlab-server==2.10.3
      - jupyterlab-widgets==1.1.11
      - line-profiler==4.1.3
      - markupsafe==2.0.1
      - mccabe==0.7.0
      - mistune==0.8.4
      - nbclassic==0.3.5
      - nbclient==0.5.9
      - nbconvert==6.0.7
      - nbformat==5.1.3
      - nest-asyncio==1.6.0
      - notebook==6.4.10
      - numpy==1.19.5
      - packaging==21.3
      - pandocfilters==1.5.1
      - parso==0.7.1
      - pexpect==4.9.0
      - phe==1.5.0
      - pickleshare==0.7.5
      - pluggy==1.0.0
      - prometheus-client==0.17.1
      - prompt-toolkit==3.0.36
      - ptyprocess==0.7.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pycparser==2.21
      - pyflakes==2.5.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pyrserve==1.0.4
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - pytest-flake8==1.1.1
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyzmq==25.1.2
      - requests==2.27.1
      - scikit-learn==0.24.2
      - scipy==1.5.4
      - send2trash==1.8.3
      - six==1.17.0
      - sklearn==0.0
      - sniffio==1.2.0
      - terminado==0.12.1
      - testpath==0.6.0
      - threadpoolctl==3.1.0
      - tomli==1.2.3
      - tornado==6.1
      - traitlets==4.3.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - wcwidth==0.2.13
      - webencodings==0.5.1
      - websocket-client==1.3.1
      - widgetsnbextension==3.6.10
      - zipp==3.6.0
prefix: /opt/conda/envs/PySyft

tests/test_tensor.py::StorageTests::test_storage_offset tests/test_tensor.py::StorageTests::test_storage_offset_encrypted tests/test_tensor.py::StorageTests::test_tensor_set_ tests/test_tensor.py::StorageTests::test_tensor_set_empty tests/test_tensor.py::StorageTests::test_tensor_set_encrypted tests/test_tensor.py::StorageTests::test_tensor_set_source_nd
tests/test_tensor.py::DimTests::test_as_view tests/test_tensor.py::DimTests::test_dim_one tests/test_tensor.py::DimTests::test_resize tests/test_tensor.py::DimTests::test_resize_as tests/test_tensor.py::DimTests::test_view tests/test_tensor.py::DiagTests::test_one_dim_tensor_below_diag tests/test_tensor.py::DiagTests::test_one_dim_tensor_main_diag tests/test_tensor.py::DiagTests::test_one_dim_tensor_upper_diag tests/test_tensor.py::DiagTests::test_two_dim_tensor_below_diag tests/test_tensor.py::DiagTests::test_two_dim_tensor_main_diag tests/test_tensor.py::DiagTests::test_two_dim_tensor_upper_diag tests/test_tensor.py::AddTests::test_inplace tests/test_tensor.py::AddTests::test_scalar tests/test_tensor.py::AddTests::test_simple tests/test_tensor.py::CeilTests::test_ceil tests/test_tensor.py::CeilTests::test_ceil_ tests/test_tensor.py::ZeroTests::test_zero tests/test_tensor.py::FloorTests::test_floor tests/test_tensor.py::SubTests::test_inplace tests/test_tensor.py::SubTests::test_scalar tests/test_tensor.py::SubTests::test_simple tests/test_tensor.py::MaxTests::test_axis tests/test_tensor.py::MaxTests::test_no_dim tests/test_tensor.py::MultTests::test_inplace tests/test_tensor.py::MultTests::test_scalar tests/test_tensor.py::MultTests::test_simple tests/test_tensor.py::DivTests::test_inplace tests/test_tensor.py::DivTests::test_scalar tests/test_tensor.py::DivTests::test_simple tests/test_tensor.py::AbsTests::test_abs tests/test_tensor.py::AbsTests::test_abs_ tests/test_tensor.py::ShapeTests::test_shape tests/test_tensor.py::SqrtTests::test_sqrt tests/test_tensor.py::SqrtTests::test_sqrt_ tests/test_tensor.py::SumTests::test_dim_is_not_none_int tests/test_tensor.py::SumTests::test_dim_none_int tests/test_tensor.py::EqualTests::test_equal tests/test_tensor.py::EqualTests::test_equal_operation tests/test_tensor.py::EqualTests::test_inequality_operation tests/test_tensor.py::EqualTests::test_not_equal tests/test_tensor.py::EqualTests::test_shape_inequality_operation tests/test_tensor.py::EqualTests::test_shape_not_equal tests/test_tensor.py::SigmoidTests::test_sigmoid tests/test_tensor.py::AddmmTests::test_addmm_1d tests/test_tensor.py::AddmmTests::test_addmm_1d_ tests/test_tensor.py::AddmmTests::test_addmm_2d tests/test_tensor.py::AddmmTests::test_addmm_2d_ tests/test_tensor.py::AddcmulTests::test_addcmul_1d tests/test_tensor.py::AddcmulTests::test_addcmul_1d_ tests/test_tensor.py::AddcmulTests::test_addcmul_2d tests/test_tensor.py::AddcmulTests::test_addcmul_2d_ tests/test_tensor.py::AddcdivTests::test_addcdiv_1d tests/test_tensor.py::AddcdivTests::test_addcdiv_1d_ tests/test_tensor.py::AddcdivTests::test_addcdiv_2d tests/test_tensor.py::AddcdivTests::test_addcdiv_2d_ tests/test_tensor.py::AddmvTests::test_addmv tests/test_tensor.py::AddmvTests::test_addmv_ tests/test_tensor.py::BmmTests::test_bmm tests/test_tensor.py::BmmTests::test_bmm_size tests/test_tensor.py::AddbmmTests::test_addbmm tests/test_tensor.py::AddbmmTests::test_addbmm_ tests/test_tensor.py::BaddbmmTests::test_baddbmm tests/test_tensor.py::BaddbmmTests::test_baddbmm_ tests/test_tensor.py::TransposeTests::test_t tests/test_tensor.py::TransposeTests::test_transpose tests/test_tensor.py::TransposeTests::test_transpose_ tests/test_tensor.py::UnsqueezeTests::test_unsqueeze tests/test_tensor.py::UnsqueezeTests::test_unsqueeze_ tests/test_tensor.py::ExpTests::test_exp tests/test_tensor.py::ExpTests::test_exp_ tests/test_tensor.py::FracTests::test_frac tests/test_tensor.py::FracTests::test_frac_ tests/test_tensor.py::RsqrtTests::test_rsqrt tests/test_tensor.py::RsqrtTests::test_rsqrt_ tests/test_tensor.py::SignTests::test_sign tests/test_tensor.py::SignTests::test_sign_ tests/test_tensor.py::NumpyTests::test_numpy tests/test_tensor.py::ReciprocalTests::test_reciprocal tests/test_tensor.py::ReciprocalTests::test_reciprocal_ tests/test_tensor.py::LogTests::test_log tests/test_tensor.py::LogTests::test_log_ tests/test_tensor.py::LogTests::test_log_1p tests/test_tensor.py::LogTests::test_log_1p_ tests/test_tensor.py::ClampTests::test_clamp_float tests/test_tensor.py::ClampTests::test_clamp_float_in_place tests/test_tensor.py::ClampTests::test_clamp_int tests/test_tensor.py::ClampTests::test_clamp_int_in_place tests/test_tensor.py::CloneTests::test_clone tests/test_tensor.py::ChunkTests::test_chunk tests/test_tensor.py::ChunkTests::test_chunk_same_size tests/test_tensor.py::GtTests::test_gt__in_place_with_number tests/test_tensor.py::GtTests::test_gt__in_place_with_tensor tests/test_tensor.py::GtTests::test_gt_with_encrypted tests/test_tensor.py::GtTests::test_gt_with_number tests/test_tensor.py::GtTests::test_gt_with_tensor tests/test_tensor.py::GeTests::test_ge__in_place_with_number tests/test_tensor.py::GeTests::test_ge__in_place_with_tensor tests/test_tensor.py::GeTests::test_ge_with_encrypted tests/test_tensor.py::GeTests::test_ge_with_number tests/test_tensor.py::GeTests::test_ge_with_tensor tests/test_tensor.py::LtTests::test_lt__in_place_with_number tests/test_tensor.py::LtTests::test_lt__in_place_with_tensor tests/test_tensor.py::LtTests::test_lt_with_encrypted tests/test_tensor.py::LtTests::test_lt_with_number tests/test_tensor.py::LtTests::test_lt_with_tensor tests/test_tensor.py::LeTests::test_le__in_place_with_number tests/test_tensor.py::LeTests::test_le__in_place_with_tensor tests/test_tensor.py::LeTests::test_le_with_encrypted tests/test_tensor.py::LeTests::test_le_with_number tests/test_tensor.py::LeTests::test_le_with_tensor tests/test_tensor.py::BernoulliTests::test_bernoulli tests/test_tensor.py::BernoulliTests::test_bernoulli_ tests/test_tensor.py::MultinomialTests::test_multinomial tests/test_tensor.py::CauchyTests::test_cauchy_ tests/test_tensor.py::UniformTests::test_uniform tests/test_tensor.py::UniformTests::test_uniform_ tests/test_tensor.py::GeometricTests::test_geometric_ tests/test_tensor.py::NormalTests::test_normal tests/test_tensor.py::NormalTests::test_normal_ tests/test_tensor.py::FillTests::test_fill_ tests/test_tensor.py::TopkTests::test_topK tests/test_tensor.py::TolistTests::test_to_list tests/test_tensor.py::TraceTests::test_trace tests/test_tensor.py::RoundTests::test_round tests/test_tensor.py::RoundTests::test_round_ tests/test_tensor.py::RepeatTests::test_repeat tests/test_tensor.py::PowTests::test_pow tests/test_tensor.py::PowTests::test_pow_ tests/test_tensor.py::NegTests::test_neg tests/test_tensor.py::NegTests::test_neg_ tests/test_tensor.py::SinTests::test_sin tests/test_tensor.py::SinhTests::test_sinh tests/test_tensor.py::CosTests::test_cos tests/test_tensor.py::CoshTests::test_cosh tests/test_tensor.py::TanTests::test_tan tests/test_tensor.py::TanhTests::test_tanh_ tests/test_tensor.py::ProdTests::test_prod tests/test_tensor.py::RandomTests::test_random_ tests/test_tensor.py::NonzeroTests::test_non_zero tests/test_tensor.py::CumprodTest::test_cumprod tests/test_tensor.py::CumprodTest::test_cumprod_ tests/test_tensor.py::SqueezeTests::test_squeeze tests/test_tensor.py::ExpandAsTests::test_expand_as tests/test_tensor.py::MeanTests::test_mean tests/test_tensor.py::NotEqualTests::test_ne tests/test_tensor.py::NotEqualTests::test_ne_ tests/test_tensor.py::IndexTests::test_index tests/test_tensor.py::IndexTests::test_index_add_ tests/test_tensor.py::IndexTests::test_index_copy_ tests/test_tensor.py::IndexTests::test_index_fill_ tests/test_tensor.py::IndexTests::test_index_select tests/test_tensor.py::IndexTests::test_index_slice_notation tests/test_tensor.py::IndexTests::test_indexing tests/test_tensor.py::GatherTests::test_gather_numerical_1 tests/test_tensor.py::GatherTests::test_gather_numerical_2 tests/test_tensor.py::ScatterTests::test_scatter_dim_out_Of_range tests/test_tensor.py::ScatterTests::test_scatter_index_out_of_range tests/test_tensor.py::ScatterTests::test_scatter_index_src_dimension_mismatch tests/test_tensor.py::ScatterTests::test_scatter_index_type tests/test_tensor.py::ScatterTests::test_scatter_numerical_0 tests/test_tensor.py::ScatterTests::test_scatter_numerical_1 tests/test_tensor.py::ScatterTests::test_scatter_numerical_2 tests/test_tensor.py::ScatterTests::test_scatter_numerical_3 tests/test_tensor.py::ScatterTests::test_scatter_numerical_4 tests/test_tensor.py::ScatterTests::test_scatter_numerical_5 tests/test_tensor.py::ScatterTests::test_scatter_numerical_6 tests/test_tensor.py::RemainderTests::test_remainder_ tests/test_tensor.py::RemainderTests::test_remainder_broadcasting tests/test_tensor.py::MvTests::test_mv tests/test_tensor.py::MvTests::test_mv_tensor tests/test_tensor.py::NarrowTests::test_narrow_float tests/test_tensor.py::NarrowTests::test_narrow_int tests/test_tensor.py::MaskedScatterTests::test_masked_scatter_1 tests/test_tensor.py::MaskedScatterTests::test_masked_scatter_braodcasting_1 tests/test_tensor.py::MaskedScatterTests::test_masked_scatter_braodcasting_2 tests/test_tensor.py::MaskedFillTests::test_masked_fill_ tests/test_tensor.py::MaskedFillTests::test_masked_fill_broadcasting tests/test_tensor.py::MaskedSelectTests::test_masked_select tests/test_tensor.py::MaskedSelectTests::test_masked_select_broadcasting_1 tests/test_tensor.py::MaskedSelectTests::test_masked_select_broadcasting_2 tests/test_tensor.py::MaskedSelectTests::test_tensor_base_masked_select tests/test_tensor.py::EqTests::test_eq_in_place_with_number tests/test_tensor.py::EqTests::test_eq_in_place_with_tensor tests/test_tensor.py::EqTests::test_eq_with_number tests/test_tensor.py::EqTests::test_eq_with_tensor tests/test_tensor.py::MmTests::test_mm_1d tests/test_tensor.py::MmTests::test_mm_2d tests/test_tensor.py::MmTests::test_mm_3d tests/test_tensor.py::NewTensorTests::test_encrypted_error tests/test_tensor.py::NewTensorTests::test_return_new_float_tensor tests/test_tensor.py::NewTensorTests::test_return_new_int_tensor tests/test_tensor.py::HalfTests::test_half_1 tests/test_tensor.py::HalfTests::test_half_2 tests/test_tensor.py::FmodTests::test_fmod_number tests/test_tensor.py::FmodTests::test_fmod_tensor tests/test_tensor.py::FmodTestsBis::test_fmod_number tests/test_tensor.py::FmodTestsBis::test_fmod_tensor tests/test_tensor.py::NumelTests::test_numel_2d tests/test_tensor.py::NumelTests::test_numel_3d tests/test_tensor.py::NumelTests::test_numel_encrypted tests/test_tensor.py::NumelTests::test_numel_float tests/test_tensor.py::NumelTests::test_numel_int tests/test_tensor.py::NumelTests::test_numel_str tests/test_tensor.py::NelementTests::test_nelement_2d tests/test_tensor.py::NelementTests::test_nelement_3d tests/test_tensor.py::NelementTests::test_nelement_encrypted tests/test_tensor.py::NelementTests::test_nelement_float tests/test_tensor.py::NelementTests::test_nelement_int tests/test_tensor.py::NelementTests::test_nelement_str tests/test_tensor.py::SizeTests::test_size_2d tests/test_tensor.py::SizeTests::test_size_3d tests/test_tensor.py::SizeTests::test_size_float tests/test_tensor.py::SizeTests::test_size_int tests/test_tensor.py::SizeTests::test_size_str tests/test_tensor.py::LerpTests::test_lerp tests/test_tensor.py::LerpTests::test_lerp_ tests/test_tensor.py::ModeTests::testMode_axis_None tests/test_tensor.py::ModeTests::testMode_axis_col tests/test_tensor.py::ModeTests::testMode_axis_row tests/test_tensor.py::RenormTests::testRenorm tests/test_tensor.py::RenormTests::testRenorm_ tests/test_tensor.py::SparseTests::test_sparse tests/test_tensor.py::SparseTests::test_sparse_ tests/test_tensor.py::StrideTests::test_stride tests/test_tensor.py::UnfoldTest::test_unfold_big tests/test_tensor.py::UnfoldTest::test_unfold_small tests/test_tensor.py::SplitTests::test_split tests/test_tensor.py::CrossTests::test_cross
syft/tensor.py
syft/tensor.py