Repository: OpenMined/PySyft

Issue:
search over tagged AdditiveSharingTensor
**Describe the bug**
Not possible to search over pointers

**To Reproduce**
Steps to reproduce the behavior:
1. Share data over workers
```
x_alice = torch.tensor([15])
x_alice.tags = ["x_alice"]
ptr_x_alice = x_alice.send(alice)
encrypted_x_alice = x_alice.share(alice, bob, charlie)
encrypted_x_alice.tags = ["enc_x_alice"]
ptr_enc_x_alice = encrypted_x_alice.send(alice)
```

2. Search over previous date tagged
```
>>> alice.search("x_alice")
[(Wrapper)>[PointerTensor | me:76577566073 -> alice:97888217298]]
>>> alice.search("enc_x_alice")
[]
```

In addition, I can ched that ptr has been send because:
```
print(alice.list_objects_remote())
{97888217298: tensor([15])
	Tags: x_alice 
	Shape: torch.Size([1]), 30882456864: tensor([2550562729003484850]), 94380707077: (Wrapper)>[AdditiveSharingTensor]
	-> tensor([2550562729003484850])
	-> [PointerTensor | alice:26890155426 -> bob:40329843004]
	-> [PointerTensor | alice:83545414165 -> charlie:2297723963]
	*crypto provider: me*}
```

**Expected behavior**
```
>>> alice.search("enc_x_alice")
(Wrapper)>[AdditiveSharingTensor]
	-> tensor([2550562729003484850])
	-> [PointerTensor | alice:26890155426 -> bob:40329843004]
	-> [PointerTensor | alice:83545414165 -> charlie:2297723963]
	*crypto provider: me*}
```


**Desktop (please complete the following information):**
- Ubuntu 18.04
- requirements.txt:
  - syft[udacity]




Discussion:
Looking into this

Resolving patch:
diff --git a/syft/serde/torch_serde.py b/syft/serde/torch_serde.py
--- a/syft/serde/torch_serde.py
+++ b/syft/serde/torch_serde.py
@@ -241,6 +241,11 @@ def _detail_torch_tensor(worker: AbstractWorker, tensor_tuple: tuple) -> torch.T
         hook=syft.torch.hook, obj=tensor, owner=worker, id=tensor_id, init_args=[], init_kwargs={}
     )
 
+    if chain is not None:
+        chain = syft.serde._detail(worker, chain)
+        tensor.child = chain
+        tensor.is_wrapper = True
+
     if tags is not None:
 
         tags = list(tags)
@@ -257,11 +262,6 @@ def _detail_torch_tensor(worker: AbstractWorker, tensor_tuple: tuple) -> torch.T
             description = description.decode("utf-8")
         tensor.description = description
 
-    if chain is not None:
-        chain = syft.serde._detail(worker, chain)
-        tensor.child = chain
-        tensor.is_wrapper = True
-
     return tensor
 
 


Test patch:
diff --git a/test/torch/tensors/test_additive_shared.py b/test/torch/tensors/test_additive_shared.py
--- a/test/torch/tensors/test_additive_shared.py
+++ b/test/torch/tensors/test_additive_shared.py
@@ -873,3 +873,17 @@ def forward(self, x):
     sh_data = torch.zeros((1, 1, 28, 28)).fix_precision().share(alice, bob, crypto_provider=james)
 
     assert torch.allclose(sh_model(sh_data).get().float_prec(), model(data), atol=1e-2)
+
+
+def test_correct_tag_and_description_after_send(workers):
+    bob, alice, james = (workers["bob"], workers["alice"], workers["james"])
+
+    x = torch.tensor([1, 2, 3]).share(alice, bob, james)
+    x.tags = ["tag_additive_test1", "tag_additive_test2"]
+    x.description = "description_additive_test"
+
+    pointer_x = x.send(alice)
+
+    assert alice.search("tag_additive_test1")
+    assert alice.search("tag_additive_test2")
+    assert alice.search("description_additive_test")