// File: /workspace/github_cpp_makefile_star2_O1/xbai0624[P]dnn/./include/Layer.h
// Function: Images::Tensorization(unsigned long, unsigned long) const
Images Tensorization(size_t I, size_t J) const
    {
        // this is the inverse operation for vectorization
        // used for backward propagation, 1D layer to 2D layer
        //     [I J] is the dimension of tensorized kernel matrix
        assert(OutputImageFromKernel.size() == 1); // make sure this is from 1D layer (only one kernel)
        Matrix tmp = OutputImageFromKernel[0];
        auto dim = tmp.Dimension();
        assert(dim.second == 1); // make sure it is a one-collumn matrix
        size_t unit_quantity = I * J; //  number of elements in each tensorized kernel
        assert(dim.first%unit_quantity == 0);

        int nKernels = dim.first/unit_quantity;
        Images Ret;
        for(size_t i=0;i<(size_t)nKernels;i++)
        {
            Matrix _tmp = tmp.GetSection(i*unit_quantity, (i+1)*unit_quantity, 0, 1);
            Matrix _t = _tmp.Reshape(I, J);
            Ret.OutputImageFromKernel.push_back(_t);
        }
        //std::cout<<"before return: "<<&Ret<<std::endl;
        return Ret;
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, 0x10(%rsp)
movq %rsi, %rax
movq %rdi, 0x8(%rsp)
movq (%rsi), %rsi
movq 0x8(%rax), %rax
subq %rsi, %rax
cmpq $0x18, %rax
jne 0x26c64
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x1aafe
movq %r12, %rdi
callq 0x1ac7c
cmpq $0x1, %rdx
jne 0x26c83
movq 0x18(%rsp), %r14
imulq 0x10(%rsp), %r14
xorl %edx, %edx
divq %r14
testq %rdx, %rdx
jne 0x26ca2
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rcx
movups %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
movq %rax, %rcx
shlq $0x20, %rcx
je 0x26c46
movslq %eax, %rbx
xorl %r12d, %r12d
leaq 0x50(%rsp), %r13
leaq 0x38(%rsp), %rbp
xorl %r15d, %r15d
movq %r12, %rdx
addq %r14, %r12
movl $0x0, (%rsp)
movl $0x1, %r9d
xorps %xmm0, %xmm0
movq %r13, %rdi
leaq 0x20(%rsp), %rsi
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x1c954
movq %rbp, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x1c1c4
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x13a14
incq %r15
movq %rbp, %rdi
callq 0x1acb6
movq %r13, %rdi
callq 0x1acb6
cmpq %rbx, %r15
jb 0x26be3
leaq 0x20(%rsp), %rdi
callq 0x1acb6
movq 0x8(%rsp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x146b(%rip), %rdi      # 0x280d6
leaq 0x29f0(%rip), %rsi      # 0x29662
leaq 0x4baf(%rip), %rcx      # 0x2b828
movl $0x169, %edx            # imm = 0x169
callq 0x4160
leaq 0x1430(%rip), %rdi      # 0x280ba
leaq 0x29d1(%rip), %rsi      # 0x29662
leaq 0x4b90(%rip), %rcx      # 0x2b828
movl $0x16c, %edx            # imm = 0x16C
callq 0x4160
leaq 0x4bb2(%rip), %rdi      # 0x2b85b
leaq 0x29b2(%rip), %rsi      # 0x29662
leaq 0x4b71(%rip), %rcx      # 0x2b828
movl $0x16e, %edx            # imm = 0x16E
callq 0x4160
movq %rax, %r14
jmp 0x26cf1
movq %rax, %r14
jmp 0x26ce7
movq %rax, %r14
jmp 0x26cdd
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x1acb6
leaq 0x50(%rsp), %rdi
callq 0x1acb6
movq 0x8(%rsp), %rdi
callq 0x136aa
leaq 0x20(%rsp), %rdi
callq 0x1acb6
movq %r14, %rdi
callq 0x43e0
nop