I am trying to write a code that deals with repeated deserialization of tensors followed by contracting them and storing the result in another tensor. Here is an example of how the code looks like :
I_vvoo = zeros(Float64, nv, nv, no, no)
g_oooo = deserialize("g_oooo.jlbin")
INTpp_vvoo = deserialize("INTpp_vvoo.jlbin")
@tensor I_vvoo[a_1, a_2, i_1, i_2] += 1 / 2 * g_oooo[i_3, i_4, i_1, i_2] * INTpp_vvoo[a_1, a_2, i_3, i_4]
INTpp_vvoo = nothing
g_oooo = nothing
g_vvoo = deserialize("g_vvoo.jlbin")
@tensor I_vvoo[a_1, a_2, i_1, i_2] += 1 / 2 * g_vvoo[a_1, a_2, i_1, i_2]
g_vvoo = nothing
g_vvvo = deserialize("g_vvvo.jlbin")
T1_vo = deserialize("T1_vo.jlbin")
@tensor I_vvoo[a_1, a_2, i_1, i_2] += g_vvvo[a_2, a_1, a_3, i_1] * T1_vo[a_3, i_2]
T1_vo = nothing
g_vvvo = nothing
g_voov = deserialize("g_voov.jlbin")
T2_vvoo = deserialize("T2_vvoo.jlbin")
@tensor I_vvoo[a_1, a_2, i_1, i_2] += -1 * g_voov[a_2, i_3, i_2, a_3] * T2_vvoo[a_1, a_3, i_3, i_1]
This things will be done repeatedly in a loop. The problem is - timing the loop would measure the time of everything inside the loop. I only want to measure the time taken for the tensor contractions that are happening. Any ideas on how to achieve the same?