Brevitas Trained Model Does Not Get Exported To ONNX

I have trained my brevitas model with Brevitas. Now I am trying to export my onnx model to use it with finn. As I try to export my model with the command below:

build_dir = "./"

base_file_name = "my_model"

bo.export_finn_onnx(my_model, (1, 3, 1024), build_dir + "/{}.onnx".format(base_file_name))

I get the error message as:

TypeError: max_pool1d(): argument ‘kernel_size’ (position 2) must be tuple of ints, not Tensor,

I couldn’t figure it out how to export my .pth extended file. If you help I will be appreciated. Thank you

Here is how my max pool 1 d line works by the way if it helps.

   pool_size = int(xb.size(-1))
        xb = F.max_pool1d(xb, pool_size).squeeze()

I have changed my code to that after I have read a bit of different comments. On its old version the code was a below, but I was still getting the same error with that too.
xb = nn.MaxPool1d(xb.size(-1))(xb)