Broadcast the input blob following the given shape and the broadcast rule of ncnn.
Expand has no parameters.
- inputs[0]: ncnn.Mat
- bottom_blobs[0]; An ncnn.Mat of input data.
- inputs[1]: ncnn.Mat
- bottom_blobs[1]; An 1-dim ncnn.Mat. A valid shape of ncnn.Mat.
- outputs[0]: T
- top_blob; The blob of ncnn.Mat which expanded by given shape and broadcast rule of ncnn.
- ncnn.Mat: Mat(float32)
Given the data and indice blob, gather entries of the axis dimension of data indexed by indices.
Type | Parameter | Description |
---|---|---|
int |
axis |
Which axis to gather on. Default is 0. |
- inputs[0]: ncnn.Mat
- bottom_blobs[0]; An ncnn.Mat of input data.
- inputs[1]: ncnn.Mat
- bottom_blobs[1]; An 1-dim ncnn.Mat of indices on given axis.
- outputs[0]: T
- top_blob; The blob of ncnn.Mat which gathered by given data and indice blob.
- ncnn.Mat: Mat(float32)
Get the shape of the ncnn blobs.
Shape has no parameters.
- inputs[0]: ncnn.Mat
- bottom_blob; An ncnn.Mat of input data.
- outputs[0]: T
- top_blob; 1-D ncnn.Mat of shape (bottom_blob.dims,), `bottom_blob.dims` is the input blob dimensions.
- ncnn.Mat: Mat(float32)
Get the indices and value(optional) of largest or smallest k data among the axis. This op will map to onnx op TopK
, ArgMax
, and ArgMin
.
Type | Parameter | Description |
---|---|---|
int |
axis |
The axis of data which topk calculate on. Default is -1, indicates the last dimension. |
int |
largest |
The binary value which indicates the TopK operator selects the largest or smallest K values. Default is 1, the TopK selects the largest K values. |
int |
sorted |
The binary value of whether returning sorted topk value or not. If not, the topk returns topk values in any order. Default is 1, this operator returns sorted topk values. |
int |
keep_dims |
The binary value of whether keep the reduced dimension or not. Default is 1, each output blob has the same dimension as input blob. |
- inputs[0]: ncnn.Mat
- bottom_blob[0]; An ncnn.Mat of input data.
- inputs[1] (optional): ncnn.Mat
- bottom_blob[1]; An optional ncnn.Mat. A blob of K in TopK. If this blob not exist, K is 1.
- outputs[0]: T
- top_blob[0]; If outputs has only 1 blob, outputs[0] is the indice blob of topk, if outputs has 2 blobs, outputs[0] is the value blob of topk. This blob is ncnn.Mat format with the shape of bottom_blob[0] or reduced shape of bottom_blob[0].
- outputs[1]: T
- top_blob[1] (optional); If outputs has 2 blobs, outputs[1] is the value blob of topk. This blob is ncnn.Mat format with the shape of bottom_blob[0] or reduced shape of bottom_blob[0].
- ncnn.Mat: Mat(float32)