// File: /workspace/github_cpp_makefile_star2_O2/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 0x20a2f
leaq 0x20(%rsp), %r12
movq %r12, %rdi
callq 0x1796e
movq %r12, %rdi
callq 0x17a6a
cmpq $0x1, %rdx
jne 0x20a4e
movq 0x18(%rsp), %r14
imulq 0x10(%rsp), %r14
xorl %edx, %edx
divq %r14
testq %rdx, %rdx
jne 0x20a6d
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rcx
andq $0x0, 0x10(%rcx)
movups %xmm0, (%rcx)
movslq %eax, %rbx
xorl %edx, %edx
leaq 0x50(%rsp), %r12
leaq 0x38(%rsp), %r13
xorl %r15d, %r15d
cmpq %rbx, %r15
jae 0x20a11
leaq (%r14,%rdx), %rbp
andl $0x0, (%rsp)
xorps %xmm0, %xmm0
movq %r12, %rdi
leaq 0x20(%rsp), %rsi
movq %rbp, %rcx
xorl %r8d, %r8d
pushq $0x1
popq %r9
callq 0x19010
movq %r13, %rdi
movq %r12, %rsi
movq 0x10(%rsp), %rdx
movq 0x18(%rsp), %rcx
callq 0x18a0c
movq 0x8(%rsp), %rdi
movq %r13, %rsi
callq 0x1139c
movq %r13, %rdi
callq 0x17a9a
movq %r12, %rdi
callq 0x17a9a
incq %r15
movq %rbp, %rdx
jmp 0x209b0
leaq 0x20(%rsp), %rdi
callq 0x17a9a
movq 0x8(%rsp), %rax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x15f1(%rip), %rdi      # 0x22027
leaq 0x2ba8(%rip), %rsi      # 0x235e5
leaq 0x4d54(%rip), %rcx      # 0x25798
movl $0x169, %edx            # imm = 0x169
callq 0x4180
leaq 0x15b6(%rip), %rdi      # 0x2200b
leaq 0x2b89(%rip), %rsi      # 0x235e5
leaq 0x4d35(%rip), %rcx      # 0x25798
movl $0x16c, %edx            # imm = 0x16C
callq 0x4180
leaq 0x4d57(%rip), %rdi      # 0x257cb
leaq 0x2b6a(%rip), %rsi      # 0x235e5
leaq 0x4d16(%rip), %rcx      # 0x25798
movl $0x16e, %edx            # imm = 0x16E
callq 0x4180
movq %rax, %r14
jmp 0x20abc
movq %rax, %r14
leaq 0x38(%rsp), %rdi
callq 0x17a9a
jmp 0x20aa3
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x17a9a
jmp 0x20ab2
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x110e4
leaq 0x20(%rsp), %rdi
callq 0x17a9a
movq %r14, %rdi
callq 0x43b0