About ''.narrow''

Hi,
I encounter the problem when I try to modify the code.I did not find the indentation problem after checking, so does the problem occur in the use of narrow?I’m thinking of changing the second division to third division through narrow.
Looking forward to your answers. Thanks!

        s1_output_cla = output_cla.narrow(0, 0, int(inputs.size(0)/3))
        s2_output_cla = output_cla.narrow(0, int(inputs.size(0)/3, int(inputs.size(0)/3))
        s1_output_rec = output_rec_s1.narrow(0, 0, int(inputs.size(0)/3))
        s2_output_rec = output_rec_s2.narrow(0, int(inputs.size(0)/3, int(inputs.size(0)/3))
        t_output_rec = output_rec_t.narrow(0, int(inputs.size(0)*2/3), int(inputs.size(0)/3))
        s1_z = output_z.narrow(0, 0, int(output_z.size(0)/3))
        s2_z = output_z.narrow(0, int(output_z.size(0)/3, int(output_z.size(0)/3))
        t_z = output_z.narrow(0, int(output_z.size(0)*2/3), int(output_z.size(0)/3))

Hi,

Could you share the full stack trace of the error please?

  File "F:\MDA\main-office.py", line 451
    s1_output_rec = output_rec_s1.narrow(0, 0, int(inputs.size(0)/3))
                ^
SyntaxError: invalid syntax
[Finished in 0.1s with exit code 1]

I think you’re missing a closing parenthesis on the line above this one. It should be:

        s2_output_cla = output_cla.narrow(0, int(inputs.size(0)/3), int(inputs.size(0)/3))

Thank you very much! I am dazzled.