In the last tutorials, we've been initializing our hook and all of our workers by hand every time. This can be a bit annoying when you're just playing around / learning about the interfaces. So, from here on out we'll be creating all these same variables using a special convenience function.
In [ ]:
    
import torch
import syft as sy
sy.create_sandbox(globals())
    
In [ ]:
    
workers
    
We also populated lots of global variables which we can use right away!
In [ ]:
    
hook
    
In [ ]:
    
bob
    
In [ ]:
    
x = torch.tensor([1,2,3,4,5]).tag("#fun", "#boston", "#housing").describe("The input datapoints to the boston housing dataset.")
y = torch.tensor([1,2,3,4,5]).tag("#fun", "#boston", "#housing").describe("The input datapoints to the boston housing dataset.")
z = torch.tensor([1,2,3,4,5]).tag("#fun", "#mnist",).describe("The images in the MNIST training dataset.")
    
In [ ]:
    
x
    
In [ ]:
    
x = x.send(bob)
y = y.send(bob)
z = z.send(bob)
# this searches for exact match within a tag or within the description
results = bob.search(["#boston", "#housing"])
    
In [ ]:
    
results
    
In [ ]:
    
print(results[0].description)
    
In [ ]:
    
grid = sy.PrivateGridNetwork(*workers)
    
In [ ]:
    
results = grid.search("#boston")
    
In [ ]:
    
boston_data = grid.search("#boston","#data")
    
In [ ]:
    
boston_target = grid.search("#boston","#target")
    
In [ ]: