if len(args) > 5:
raise TypeError("Layer can receive at most 4 positional arguments.")
if len(args) == 5:
if isinstance(args[2], int) and isinstance(args[3], int) and isinstance(args[4], int):
kernel_size = (args[2], args[3], args[4])
args = [args[0], args[1], kernel_size]
converted.append(("kernel_size", "kernel_dim*"))
After Change
if len(args) > 5:
raise TypeError("Layer can receive at most 4 positional arguments.")
if len(args) == 5:
if all([isinstance(x, int) for x in args[2:5]]):
kernel_size = (args[2], args[3], args[4])
args = [args[0], args[1], kernel_size]
converted.append(("kernel_size", "kernel_dim*"))