// File: /workspace/github_cpp_makefile_star2_O2/btbujiangjun[P]abcdl/src/fnn/Layer.cpp
// Function: abcdl::fnn::BatchNormalizationLayer::forward(abcdl::fnn::Layer*)
void BatchNormalizationLayer::forward(Layer* pre_layer){
    auto input = pre_layer->get_activate_data();
    CHECK(input.cols() == this->_weight.cols());
    _means = input.mean(abcdl::algebra::Axis_type::COL);
    _variances = (input - _means).pow(2).mean(abcdl::algebra::Axis_type::COL);
    _scales = (_variances + _epsilon).sqrt().inverse();
    _normalize = (input - _means) * _scales;
    this->_activate_data = _normalize * this->_weight.get_row(0) + this->_weight.get_row(1); 
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x230, %rsp            # imm = 0x230
movq %rdi, %rbx
addq $0xa0, %rsi
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x11164
movq 0x8(%r14), %rax
cmpq 0x38(%rbx), %rax
jne 0x13ef3
leaq 0xa8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
pushq $0x1
popq %rdx
callq 0x24376
leaq 0x170(%rbx), %r14
leaq 0xa8(%rsp), %rsi
movq %r14, %rdi
callq 0x1dee2
leaq 0xa8(%rsp), %rdi
callq 0x17fd6
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x1e458
leaq 0x58(%rsp), %rsi
movl $0x40000000, (%rsi)     # imm = 0x40000000
leaq 0x8(%rsp), %rdi
callq 0x23bf6
leaq 0xa8(%rsp), %rdi
pushq $0x1
popq %rdx
movq %rax, %rsi
callq 0x24376
leaq 0x198(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x1dee2
leaq 0xa8(%rsp), %rdi
callq 0x17fd6
leaq 0x8(%rsp), %rdi
callq 0x17fd6
leaq 0x168(%rbx), %rdx
leaq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x1df6e
leaq 0x8(%rsp), %rdi
callq 0x23c8e
leaq 0xa8(%rsp), %rdi
movq %rax, %rsi
callq 0x244e4
leaq 0x1c0(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x1dee2
leaq 0xa8(%rsp), %rdi
callq 0x17fd6
leaq 0x8(%rsp), %rdi
callq 0x17fd6
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq %r14, %rdx
callq 0x1e458
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
movq %r15, %rdx
callq 0x1e876
leaq 0x1e8(%rbx), %r15
leaq 0xa8(%rsp), %rsi
movq %r15, %rdi
callq 0x1dee2
leaq 0x30(%rbx), %r14
leaq 0xa8(%rsp), %rdi
callq 0x17fd6
leaq 0x8(%rsp), %rdi
callq 0x17fd6
leaq 0x58(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r14, %rsi
xorl %edx, %edx
callq 0x18278
leaq 0x8(%rsp), %rdi
leaq 0x58(%rsp), %rdx
movq %r15, %rsi
callq 0x1e876
leaq 0x80(%rsp), %rdi
pushq $0x1
popq %rcx
movq %r14, %rsi
movq %rcx, %rdx
callq 0x18278
leaq 0xa8(%rsp), %rdi
leaq 0x8(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x1e000
addq $0xa0, %rbx
leaq 0xa8(%rsp), %rsi
movq %rbx, %rdi
callq 0x1dee2
leaq 0xa8(%rsp), %rdi
callq 0x17fd6
leaq 0x80(%rsp), %rdi
callq 0x17fd6
leaq 0x8(%rsp), %rdi
callq 0x17fd6
leaq 0x58(%rsp), %rdi
callq 0x17fd6
leaq 0x30(%rsp), %rdi
callq 0x17fd6
addq $0x230, %rsp            # imm = 0x230
popq %rbx
popq %r14
popq %r15
retq
leaq 0x1dff6(%rip), %rsi     # 0x31ef0
leaq 0xa8(%rsp), %rdi
pushq $0x3e
popq %rdx
pushq $0x3
popq %rcx
callq 0x2ee18
leaq 0x1e015(%rip), %rsi     # 0x31f29
leaq 0xa8(%rsp), %rdi
callq 0x9370
leaq 0xa8(%rsp), %rdi
callq 0x2f054
jmp 0x13ced
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x2f054
jmp 0x13fc8
jmp 0x13fb4
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x17fd6
jmp 0x13f5f
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
callq 0x17fd6
jmp 0x13f71
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x17fd6
jmp 0x13f80
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
jmp 0x13fc3
jmp 0x13fb4
jmp 0x13f93
jmp 0x13fbb
jmp 0x13fb4
jmp 0x13f93
jmp 0x13fb4
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
callq 0x17fd6
jmp 0x13fbe
jmp 0x13fb4
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x13fc3
movq %rax, %rbx
jmp 0x13fc8
jmp 0x13fbb
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x17fd6
leaq 0x30(%rsp), %rdi
callq 0x17fd6
movq %rbx, %rdi
callq 0x95e0