You would have to create a model instance before passing in the inputs:
model = CustomNeuralNet(num_classes)
outputs = model(inputs)

Based on the error message it seems you are trying to pass the inputs directly to the initialization of the model.