Hi Hell!
You are posting misleading code.
This version of MLPUpdated:



 Hell_Razor:

class MLPUpdated(nn.Module):
    def __init__(self):
...



comes from self-contained code you posted (which would be good
if it were relevant, but it isn’t), while this version:


from models import LeNetComplete, MLP, MLPUpdated



comes from some package called “models.”
And we know that these two versions of MLPUpdated differ
substantively because, among other reasons, your self-contained
version does not contain a .send() method.
You are probably using your “federated learning” Syft framework
incorrectly.  (But I don’t know …)
Note, you call your model differently in your train and test loops:


def train(args, model, device, train_loader, optimizer, epoch):
    model.train()
...
    for batch_idx, (data, target) in enumerate(train_loader):
        model.send(data.location)
...
        print("Train: ", data.shape)
        # print("Train Type: ", type(data.location))
        output = model(data)
...
        model.get()



vs.


def test(args, model, device, test_loader, epoch):
    model.eval()
...
    with torch.no_grad():
        for data, target in test_loader:
            data, target = data.to(device), target.to(device)

            # Feed-forward data through the model
            print("Test: ", data.shape)
            # print("Test Type: ", type(target))
            output = model(data)
...



I have two suggestions for you:


Debugging 101:  Trim down your code to the simplest version that
still shows the error.  Can you get rid of the ArgumentParser()
stuff?  The plotting stuff?  Can you get rid of .to (device)?
Can you get rid of the data loaders?  Can you get rid of the loops
and just make a single train and test call to model (data)?  Can
you get rid of the syft stuff and still reproduce the error?  (I doubt it.)


Try printing out type (model), type (model).mro(),
type (data), and type (data).mro() just before your train
and test calls to model (data) to see what Syft is doing under
the hood.  Maybe you’re trying to call a “syft-hooked” model with
an ordinary pytorch tensor, or vice versa.


(As an aside, let me note that the code you posted that reproduces
your error is not a “complete, self-contained, runnable script.”)
Best.
K. Frank