About computational graph

Hi, all,

I’m using the computational graph output from relay, which is like the following.

%0 = nn.pad(%input_1, pad_width=[[0, 0], [0, 0], [3, 3], [3, 3]])
%1 = nn.conv2d(%0, %v_param_1, strides=[2, 2], channels=64, kernel_size=[7, 7])
%2 = nn.bias_add(%1, %v_param_2)
%3 = nn.batch_norm(%2, %v_param_3, %v_param_4, %v_param_5, %v_param_6, epsilon=0.001)
%4 = %3.0
%5 = nn.relu(%4)
%6 = nn.pad(%5, pad_width=[[0, 0], [0, 0], [1, 1], [1, 1]])
%7 = nn.max_pool2d(%6, pool_size=[3, 3], strides=[2, 2])
%8 = nn.conv2d(%7, %v_param_7, channels=64, kernel_size=[1, 1])
%9 = nn.bias_add(%8, %v_param_8)
%10 = nn.batch_norm(%9, %v_param_9, %v_param_10, %v_param_11, %v_param_12, epsilon=0.001)
%11 = %10.0
%12 = nn.relu(%11)

Most of these expressions are lucid, except ’ %4 = %3.0’ and ’ %11 = %10.0’. Could anyone tell me what they mean? Quantification? And it would be better if you tell me where I can read a relevant introduction.

Thanks in advance.

Hi! e.n is syntax for tuple projection. i.e. it gets the nth element out of the tuple e. You can learn more about Relay and its text format in the developer introduction and the language reference. Here’s a specific link to tuple projection. Let me know if you have any further questions.

Thanks josh, I’m going to peruse these articles first.