// File: /workspace/github_cpp_makefile_star2_O3/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 0x26b9c
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x1aa3e
movq %r12, %rdi
callq 0x1abb8
cmpq $0x1, %rdx
jne 0x26bbb
movq 0x18(%rsp), %r14
imulq 0x10(%rsp), %r14
xorl %edx, %edx
divq %r14
testq %rdx, %rdx
jne 0x26bda
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rcx
movups %xmm0, (%rcx)
movq $0x0, 0x10(%rcx)
movq %rax, %rcx
shlq $0x20, %rcx
je 0x26b7e
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 0x1c864
movq %rbp, %rdi
movq %r13, %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x1c0d2
movq 0x8(%rsp), %rdi
movq %rbp, %rsi
callq 0x138a4
incq %r15
movq %rbp, %rdi
callq 0x1abf2
movq %r13, %rdi
callq 0x1abf2
cmpq %rbx, %r15
jb 0x26b1b
leaq 0x20(%rsp), %rdi
callq 0x1abf2
movq 0x8(%rsp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x14f4(%rip), %rdi      # 0x28097
leaq 0x2a79(%rip), %rsi      # 0x29623
leaq 0x4c37(%rip), %rcx      # 0x2b7e8
movl $0x169, %edx            # imm = 0x169
callq 0x4160
leaq 0x14b9(%rip), %rdi      # 0x2807b
leaq 0x2a5a(%rip), %rsi      # 0x29623
leaq 0x4c18(%rip), %rcx      # 0x2b7e8
movl $0x16c, %edx            # imm = 0x16C
callq 0x4160
leaq 0x4c3a(%rip), %rdi      # 0x2b81b
leaq 0x2a3b(%rip), %rsi      # 0x29623
leaq 0x4bf9(%rip), %rcx      # 0x2b7e8
movl $0x16e, %edx            # imm = 0x16E
callq 0x4160
movq %rax, %r14
jmp 0x26c29
movq %rax, %r14
jmp 0x26c1f
movq %rax, %r14
jmp 0x26c15
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x1abf2
leaq 0x50(%rsp), %rdi
callq 0x1abf2
movq 0x8(%rsp), %rdi
callq 0x1353a
leaq 0x20(%rsp), %rdi
callq 0x1abf2
movq %r14, %rdi
callq 0x43e0
nop