diff --git a/syft/tensor.py b/syft/tensor.py
index 765d418508..a016eb8cfa 100644
--- a/syft/tensor.py
+++ b/syft/tensor.py
@@ -1051,9 +1051,8 @@ class TensorBase(object):
 
     def scatter_(self, dim, index, src):
         """
-        Writes all values from the Tensor src into self at the indices specified in the index Tensor.
-        The indices are specified with respect to the given dimension, dim, in the manner described in gather().
-
+        Writes all values from the Tensor ``src`` into ``self`` at the indices specified in the ``index`` Tensor.
+        The indices are specified with respect to the given dimension, ``dim``, in the manner described in gather().
         :param dim: The axis along which to index
         :param index: The indices of elements to scatter
         :param src: The source element(s) to scatter
@@ -1110,6 +1109,32 @@ class TensorBase(object):
 
         return self
 
+    def gather(self, dim, index):
+        """
+        Gathers values along an axis specified by ``dim``.
+        For a 3-D tensor the output is specified by:
+            out[i][j][k] = input[index[i][j][k]][j][k]  # if dim == 0
+            out[i][j][k] = input[i][index[i][j][k]][k]  # if dim == 1
+            out[i][j][k] = input[i][j][index[i][j][k]]  # if dim == 2
+        :param dim: The axis along which to index
+        :param index: A tensor of indices of elements to gather
+        :return: tensor of gathered values
+        """
+        index = _ensure_tensorbase(index)
+        if self.encrypted or index.encrypted:
+            return NotImplemented
+        idx_xsection_shape = index.data.shape[:dim] + index.data.shape[dim + 1:]
+        self_xsection_shape = self.data.shape[:dim] + self.data.shape[dim + 1:]
+        if idx_xsection_shape != self_xsection_shape:
+            raise ValueError("Except for dimension " + str(dim) +
+                             ", all dimensions of index and self should be the same size")
+        if index.data.dtype != np.dtype('int_'):
+            raise TypeError("The values of index must be integers")
+        data_swaped = np.swapaxes(self.data, 0, dim)
+        index_swaped = np.swapaxes(index, 0, dim)
+        gathered = np.choose(index_swaped, data_swaped)
+        return TensorBase(np.swapaxes(gathered, 0, dim))
+
     def serialize(self):
         return pickle.dumps(self)
 

Implement Default gather Functionality for Base Tensor Type
**User Story A:** As a Data Scientist using Syft's Base Tensor type, we want to implement a default method for computing operations on a Tensor of arbitrary type. For this ticket to be complete, gather() should return a new tensor. 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 ce477234fe..fbeb064be6 100644
--- a/tests/test_tensor.py
+++ b/tests/test_tensor.py
@@ -750,6 +750,23 @@ class notEqualTests(unittest.TestCase):
         self.assertTrue(syft.equal(t1, TensorBase([1, 1, 1, 0])))
 
 
+class gatherTests(unittest.TestCase):
+    def testGatherNumerical1(self):
+        t = TensorBase(np.array([[65, 17], [14, 25], [76, 22]]))
+        idx = TensorBase(np.array([[0], [1], [0]]))
+        dim = 1
+        result = t.gather(dim=dim, index=idx)
+        self.assertTrue(np.array_equal(result.data, np.array([[65], [25], [76]])))
+
+    def testGatherNumerical2(self):
+        t = TensorBase(np.array([[47, 74, 44], [56, 9, 37]]))
+        idx = TensorBase(np.array([[0, 0, 1], [1, 1, 0], [0, 1, 0]]))
+        dim = 0
+        result = t.gather(dim=dim, index=idx)
+        expexted = [[47, 74, 37], [56, 9, 44.], [47, 9, 44]]
+        self.assertTrue(np.array_equal(result.data, np.array(expexted)))
+
+
 class scatterTests(unittest.TestCase):
     def testScatter_Numerical0(self):
         t = TensorBase(np.zeros((3, 5)))

pip install -e .
parse_log_pytest
requirements.txt
line_profiler pytest
apt-get update apt-get install -y musl-dev g++ libgmp3-dev libmpfr-dev ca-certificates
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
args==0.1.0
clint==0.5.1
exceptiongroup==1.2.2
flake8==7.2.0
iniconfig==2.1.0
line_profiler==4.2.0
mccabe==0.7.0
numpy==1.26.4
packaging==24.2
phe==1.5.0
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.2
pyRserve==1.0.4
pytest==8.3.5
pytest-flake8==1.3.0
scipy==1.13.1
-e git+https://github.com/OpenMined/PySyft.git@57cb74b0ec8a69c285a002e0a190d4c6603a06bc#egg=syft
tomli==2.2.1

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
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - 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=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - args==0.1.0
      - clint==0.5.1
      - exceptiongroup==1.2.2
      - flake8==7.2.0
      - iniconfig==2.1.0
      - line-profiler==4.2.0
      - mccabe==0.7.0
      - numpy==1.26.4
      - packaging==24.2
      - phe==1.5.0
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.2
      - pyrserve==1.0.4
      - pytest==8.3.5
      - pytest-flake8==1.3.0
      - scipy==1.13.1
      - tomli==2.2.1
prefix: /opt/conda/envs/PySyft

tests/test_tensor.py::gatherTests::testGatherNumerical1 tests/test_tensor.py::gatherTests::testGatherNumerical2
tests/test_tensor.py::scatterTests::testScatter_Numerical0 tests/test_tensor.py::scatterTests::testScatter_Numerical1 tests/test_tensor.py::scatterTests::testScatter_Numerical2 tests/test_tensor.py::scatterTests::testScatter_Numerical3 tests/test_tensor.py::scatterTests::testScatter_Numerical4 tests/test_tensor.py::scatterTests::testScatter_Numerical5 tests/test_tensor.py::scatterTests::testScatter_Numerical6
tests/test_tensor.py::DimTests::testAsView tests/test_tensor.py::DimTests::testDimOne tests/test_tensor.py::DimTests::testResize tests/test_tensor.py::DimTests::testResizeAs tests/test_tensor.py::DimTests::testSize tests/test_tensor.py::DimTests::testView tests/test_tensor.py::AddTests::testInplace tests/test_tensor.py::AddTests::testScalar tests/test_tensor.py::AddTests::testSimple tests/test_tensor.py::CeilTests::testCeil tests/test_tensor.py::CeilTests::testCeil_ tests/test_tensor.py::ZeroTests::testZero tests/test_tensor.py::FloorTests::testFloor_ tests/test_tensor.py::SubTests::testInplace tests/test_tensor.py::SubTests::testScalar tests/test_tensor.py::SubTests::testSimple tests/test_tensor.py::MaxTests::testAxis tests/test_tensor.py::MaxTests::testNoDim tests/test_tensor.py::MultTests::testInplace tests/test_tensor.py::MultTests::testScalar tests/test_tensor.py::MultTests::testSimple tests/test_tensor.py::DivTests::testInplace tests/test_tensor.py::DivTests::testScalar tests/test_tensor.py::DivTests::testSimple tests/test_tensor.py::AbsTests::testabs tests/test_tensor.py::AbsTests::testabs_ tests/test_tensor.py::ShapeTests::testShape tests/test_tensor.py::SqrtTests::testSqrt tests/test_tensor.py::SqrtTests::testSqrt_ tests/test_tensor.py::SumTests::testDimIsNotNoneInt tests/test_tensor.py::SumTests::testDimNoneInt tests/test_tensor.py::EqualTests::testEqOp tests/test_tensor.py::EqualTests::testEqual tests/test_tensor.py::EqualTests::testIneqOp tests/test_tensor.py::EqualTests::testNotEqual tests/test_tensor.py::IndexTests::testIndexing tests/test_tensor.py::sigmoidTests::testSigmoid tests/test_tensor.py::addmm::testaddmm1d tests/test_tensor.py::addmm::testaddmm2d tests/test_tensor.py::addmm::testaddmm_1d tests/test_tensor.py::addmm::testaddmm_2d tests/test_tensor.py::addcmulTests::testaddcmul1d tests/test_tensor.py::addcmulTests::testaddcmul2d tests/test_tensor.py::addcmulTests::testaddcmul_1d tests/test_tensor.py::addcmulTests::testaddcmul_2d tests/test_tensor.py::addcdivTests::testaddcdiv1d tests/test_tensor.py::addcdivTests::testaddcdiv2d tests/test_tensor.py::addcdivTests::testaddcdiv_1d tests/test_tensor.py::addcdivTests::testaddcdiv_2d tests/test_tensor.py::addmvTests::testaddmv tests/test_tensor.py::addmvTests::testaddmv_ tests/test_tensor.py::addbmmTests::testaddbmm tests/test_tensor.py::addbmmTests::testaddbmm_ tests/test_tensor.py::baddbmmTests::testbaddbmm tests/test_tensor.py::baddbmmTests::testbaddbmm_ tests/test_tensor.py::transposeTests::testT tests/test_tensor.py::transposeTests::testT_ tests/test_tensor.py::transposeTests::testTranspose tests/test_tensor.py::transposeTests::testTranspose_ tests/test_tensor.py::unsqueezeTests::testUnsqueeze tests/test_tensor.py::unsqueezeTests::testUnsqueeze_ tests/test_tensor.py::expTests::testexp tests/test_tensor.py::expTests::testexp_ tests/test_tensor.py::fracTests::testfrac tests/test_tensor.py::fracTests::testfrac_ tests/test_tensor.py::rsqrtTests::testrsqrt tests/test_tensor.py::rsqrtTests::testrsqrt_ tests/test_tensor.py::signTests::testsign tests/test_tensor.py::signTests::testsign_ tests/test_tensor.py::numpyTests::testnumpy tests/test_tensor.py::reciprocalTests::testreciprocal tests/test_tensor.py::reciprocalTests::testrsqrt_ tests/test_tensor.py::logTests::testLog tests/test_tensor.py::logTests::testLog1p tests/test_tensor.py::logTests::testLog1p_ tests/test_tensor.py::logTests::testLog_ tests/test_tensor.py::clampTests::testClampFloat tests/test_tensor.py::clampTests::testClampFloatInPlace tests/test_tensor.py::clampTests::testClampInt tests/test_tensor.py::clampTests::testClampIntInPlace tests/test_tensor.py::cloneTests::testClone tests/test_tensor.py::chunkTests::testChunk tests/test_tensor.py::chunkTests::testChunkSameSize tests/test_tensor.py::gtTests::testGtInPlaceWithNumber tests/test_tensor.py::gtTests::testGtInPlaceWithTensor tests/test_tensor.py::gtTests::testGtWithNumber tests/test_tensor.py::gtTests::testGtWithTensor tests/test_tensor.py::bernoulliTests::testBernoulli tests/test_tensor.py::bernoulliTests::testBernoulli_ tests/test_tensor.py::uniformTests::testUniform tests/test_tensor.py::uniformTests::testUniform_ tests/test_tensor.py::fillTests::testFill_ tests/test_tensor.py::topkTests::testTopK tests/test_tensor.py::tolistTests::testToList tests/test_tensor.py::traceTests::testTrace tests/test_tensor.py::roundTests::testRound tests/test_tensor.py::roundTests::testRound_ tests/test_tensor.py::repeatTests::testRepeat tests/test_tensor.py::powTests::testPow tests/test_tensor.py::powTests::testPow_ tests/test_tensor.py::prodTests::testProd tests/test_tensor.py::randomTests::testRandom_ tests/test_tensor.py::nonzeroTests::testNonZero tests/test_tensor.py::cumprodTest::testCumprod tests/test_tensor.py::cumprodTest::testCumprod_ tests/test_tensor.py::splitTests::testSplit tests/test_tensor.py::squeezeTests::testSqueeze tests/test_tensor.py::expandAsTests::testExpandAs tests/test_tensor.py::meanTests::testMean tests/test_tensor.py::notEqualTests::testNe tests/test_tensor.py::notEqualTests::testNe_ tests/test_tensor.py::scatterTests::testScatter_DimOutOfRange tests/test_tensor.py::scatterTests::testScatter_IndexOutOfRange tests/test_tensor.py::scatterTests::testScatter_IndexType tests/test_tensor.py::scatterTests::testScatter_index_src_dimension_mismatch
syft/tensor.py
syft/tensor.py