coremltools/models/neural_network/builder.py [3469:3493]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        R_i, R_f, R_o, R_z = W_h
        W_i, W_f, W_o, W_z = W_x

        weight_params.inputGateWeightMatrix.floatValue.extend(W_i.flatten())
        weight_params.forgetGateWeightMatrix.floatValue.extend(W_f.flatten())
        weight_params.outputGateWeightMatrix.floatValue.extend(W_o.flatten())
        weight_params.blockInputWeightMatrix.floatValue.extend(W_z.flatten())

        weight_params.inputGateRecursionMatrix.floatValue.extend(R_i.flatten())
        weight_params.forgetGateRecursionMatrix.floatValue.extend(R_f.flatten())
        weight_params.outputGateRecursionMatrix.floatValue.extend(R_o.flatten())
        weight_params.blockInputRecursionMatrix.floatValue.extend(R_z.flatten())

        if b is not None:
            b_i, b_f, b_o, b_z = b
            weight_params.inputGateBiasVector.floatValue.extend(b_i.flatten())
            weight_params.forgetGateBiasVector.floatValue.extend(b_f.flatten())
            weight_params.outputGateBiasVector.floatValue.extend(b_o.flatten())
            weight_params.blockInputBiasVector.floatValue.extend(b_z.flatten())

        if peep is not None:
            p_i, p_f, p_o = peep
            weight_params.inputGatePeepholeVector.floatValue.extend(p_i.flatten())
            weight_params.forgetGatePeepholeVector.floatValue.extend(p_f.flatten())
            weight_params.outputGatePeepholeVector.floatValue.extend(p_o.flatten())
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



coremltools/models/neural_network/builder.py [3655:3679]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        R_i, R_f, R_o, R_z = W_h
        W_i, W_f, W_o, W_z = W_x

        weight_params.inputGateWeightMatrix.floatValue.extend(W_i.flatten())
        weight_params.forgetGateWeightMatrix.floatValue.extend(W_f.flatten())
        weight_params.outputGateWeightMatrix.floatValue.extend(W_o.flatten())
        weight_params.blockInputWeightMatrix.floatValue.extend(W_z.flatten())

        weight_params.inputGateRecursionMatrix.floatValue.extend(R_i.flatten())
        weight_params.forgetGateRecursionMatrix.floatValue.extend(R_f.flatten())
        weight_params.outputGateRecursionMatrix.floatValue.extend(R_o.flatten())
        weight_params.blockInputRecursionMatrix.floatValue.extend(R_z.flatten())

        if b is not None:
            b_i, b_f, b_o, b_z = b
            weight_params.inputGateBiasVector.floatValue.extend(b_i.flatten())
            weight_params.forgetGateBiasVector.floatValue.extend(b_f.flatten())
            weight_params.outputGateBiasVector.floatValue.extend(b_o.flatten())
            weight_params.blockInputBiasVector.floatValue.extend(b_z.flatten())

        if peep is not None:
            p_i, p_f, p_o = peep
            weight_params.inputGatePeepholeVector.floatValue.extend(p_i.flatten())
            weight_params.forgetGatePeepholeVector.floatValue.extend(p_f.flatten())
            weight_params.outputGatePeepholeVector.floatValue.extend(p_o.flatten())
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



