MCPcopy Create free account
hub / github.com/alibaba/MNN / _MatrixBandPart

Function _MatrixBandPart

express/NeuralNetWorkOp.cpp:1107–1112  ·  view source on GitHub ↗

Copies a variable setting everything outside a central band in each innermost matrix. Arguments: input: Rank k variable. num_lower: Number of subdiagonals to keep. If negative, keep entire lower triangle. num_upper: Number of superdiagonals to keep. If negative, keep entire upper triangle. Returns: Output: Rank k variable of the same shape as input. The extracted banded tensor. */

Source from the content-addressed store, hash-verified

1105Output: Rank k variable of the same shape as input. The extracted banded tensor.
1106*/
1107VARP _MatrixBandPart(VARP input, VARP num_lower, VARP num_upper) {
1108 std::unique_ptr<OpT> op(new OpT);
1109 op->type = OpType_MatrixBandPart;
1110 op->main.type = OpParameter_NONE;
1111 return (Variable::create(Expr::create(std::move(op), {input, num_lower, num_upper})));
1112}
1113/*Calculates the mean and variance of x.
1114Args:
1115x: A variable. must be 4-D with NC4HW4 format.

Callers 2

runMethod · 0.85
runMethod · 0.85

Calls 1

createFunction · 0.50

Tested by 1

runMethod · 0.68