Browse Source

update include headers

tags/v1.2.0
shenwei41 4 years ago
parent
commit
f87dd9d016
5 changed files with 233 additions and 112 deletions
  1. +19
    -0
      third_party/fwkacllib/inc/ops/linalg_ops.h
  2. +183
    -106
      third_party/fwkacllib/inc/ops/nn_detect_ops.h
  3. +25
    -0
      third_party/fwkacllib/inc/ops/nn_norm_ops.h
  4. +4
    -4
      third_party/fwkacllib/inc/ops/nn_pooling_ops.h
  5. +2
    -2
      third_party/fwkacllib/inc/ops/pad_ops.h

+ 19
- 0
third_party/fwkacllib/inc/ops/linalg_ops.h View File

@@ -83,6 +83,25 @@ REG_OP(Cholesky)
.OP_END_FACTORY_REG(Cholesky)

/**
*@brief Computes the outer product of two 1D vectors . \n

*@par Inputs:
*The input x and vec2 has to be a 1D vector.Inputs include:
*@li x:A Tensor. Must be one of the following types: float16, float32.
Shape is [N] . \n
*@li vec2:A Tensor. Must have the same type as x. Shape is [M] . \n

*@par Outputs:
*y:A Tensor. Has the same type as x . \n
*/

REG_OP(Ger)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(vec2, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.OP_END_FACTORY_REG(Ger)

/**
*@brief Computes the sign and the log of the absolute value of the determinant
of one or more square matrices . \n



+ 183
- 106
third_party/fwkacllib/inc/ops/nn_detect_ops.h View File

@@ -254,22 +254,22 @@ is min_size/sqrt(aspect_ratio), the width is min_size*sqrt(aspect_ratio). Defaul
*@par Third-party framework compatibility
* It is a custom operator. It has no corresponding operator in Caffe.
*/
REG_OP(PriorBox)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(min_size, ListFloat)
.REQUIRED_ATTR(max_size, ListFloat)
.REQUIRED_ATTR(aspect_ratio, ListFloat)
.ATTR(img_h, Int, 0)
.ATTR(img_w, Int, 0)
.ATTR(step_h, Float, 0.0)
.ATTR(step_w, Float, 0.0)
.ATTR(flip, Bool, true)
.ATTR(clip, Bool, false)
.ATTR(offset, Float, 0.5)
.ATTR(variance, ListFloat, {0.1})
.OP_END_FACTORY_REG(PriorBox);
REG_OP(PriorBox)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(min_size, ListFloat)
.REQUIRED_ATTR(max_size, ListFloat)
.REQUIRED_ATTR(aspect_ratio, ListFloat)
.ATTR(img_h, Int, 0)
.ATTR(img_w, Int, 0)
.ATTR(step_h, Float, 0.0)
.ATTR(step_w, Float, 0.0)
.ATTR(flip, Bool, true)
.ATTR(clip, Bool, false)
.ATTR(offset, Float, 0.5)
.ATTR(variance, ListFloat, {0.1})
.OP_END_FACTORY_REG(PriorBox);

/**
*@brief Performs SSD prior box detection, with four additional matrices and the "aspect_ratio" attribute deleted compared to PriorBox . \n
@@ -306,25 +306,25 @@ is min_size/sqrt(aspect_ratio), the width is min_size*sqrt(aspect_ratio). Defaul
*@par Restrictions:
*Warning: THIS FUNCTION IS DEPRECATED. Please use PriorBox instead.
*/
REG_OP(PriorBoxD)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(data_h, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(data_w, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(box_height, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(box_width, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(min_size, ListFloat)
.REQUIRED_ATTR(max_size, ListFloat)
.ATTR(img_h, Int, 0)
.ATTR(img_w, Int, 0)
.ATTR(step_h, Float, 0.0)
.ATTR(step_w, Float, 0.0)
.ATTR(flip, Bool, true)
.ATTR(clip, Bool, false)
.ATTR(offset, Float, 0.5)
.ATTR(variance, ListFloat, {0.1})
.OP_END_FACTORY_REG(PriorBoxD);
REG_OP(PriorBoxD)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(data_h, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(data_w, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(box_height, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(box_width, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(min_size, ListFloat)
.REQUIRED_ATTR(max_size, ListFloat)
.ATTR(img_h, Int, 0)
.ATTR(img_w, Int, 0)
.ATTR(step_h, Float, 0.0)
.ATTR(step_w, Float, 0.0)
.ATTR(flip, Bool, true)
.ATTR(clip, Bool, false)
.ATTR(offset, Float, 0.5)
.ATTR(variance, ListFloat, {0.1})
.OP_END_FACTORY_REG(PriorBoxD);

/**
*@brief Performs SSD prior box detection, with four additional matrices and the "aspect_ratio" attribute deleted compared to PriorBox . \n
@@ -358,22 +358,22 @@ is min_size/sqrt(aspect_ratio), the width is min_size*sqrt(aspect_ratio). Defaul
*@par Restrictions:
*Warning: THIS FUNCTION IS DEPRECATED. Please use PriorBox instead.
*/
REG_OP(PriorBoxDV2)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(boxes, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(min_size, ListFloat)
.REQUIRED_ATTR(max_size, ListFloat)
.ATTR(img_h, Int, 0)
.ATTR(img_w, Int, 0)
.ATTR(step_h, Float, 0.0)
.ATTR(step_w, Float, 0.0)
.ATTR(flip, Bool, true)
.ATTR(clip, Bool, false)
.ATTR(offset, Float, 0.5)
.ATTR(variance, ListFloat, {0.1})
.OP_END_FACTORY_REG(PriorBoxDV2);
REG_OP(PriorBoxDV2)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(boxes, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(min_size, ListFloat)
.REQUIRED_ATTR(max_size, ListFloat)
.ATTR(img_h, Int, 0)
.ATTR(img_w, Int, 0)
.ATTR(step_h, Float, 0.0)
.ATTR(step_w, Float, 0.0)
.ATTR(flip, Bool, true)
.ATTR(clip, Bool, false)
.ATTR(offset, Float, 0.5)
.ATTR(variance, ListFloat, {0.1})
.OP_END_FACTORY_REG(PriorBoxDV2);

/**
*@brief Performs Position Sensitive ROI Pooling . \n
@@ -531,10 +531,10 @@ as xx...xyy...yww...whh...hbb...bc0c0..c0c1c1...c1......cncn...cn . \n
* It is a custom operator. It has no corresponding operator in Caffe.
*/
REG_OP(Yolo)
.INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(coord_data, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(obj_prob, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(classes_prob, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(coord_data, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(obj_prob, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(classes_prob, TensorType({DT_FLOAT16, DT_FLOAT}))
.ATTR(boxes, Int, 3)
.ATTR(coords, Int, 4)
.ATTR(classes, Int, 80)
@@ -584,10 +584,10 @@ REG_OP(Yolo)
* It is a custom operator. It has no corresponding operator in Caffe.
*/
REG_OP(YoloV2DetectionOutput)
.INPUT(coord_data, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(obj_prob, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(classes_prob, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(img_info, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(coord_data, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(obj_prob, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(classes_prob, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img_info, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(biases, ListFloat)
.ATTR(boxes, Int, 5)
.ATTR(coords, Int, 4)
@@ -598,7 +598,7 @@ REG_OP(YoloV2DetectionOutput)
.ATTR(score_threshold, Float, 0.5)
.ATTR(iou_threshold, Float, 0.45)
.ATTR(pre_nms_topn, Int, 512)
.OUTPUT(box_out, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(box_out, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(box_out_num, TensorType({DT_INT32}))
.OP_END_FACTORY_REG(YoloV2DetectionOutput)

@@ -647,12 +647,12 @@ REG_OP(YoloV2DetectionOutput)
*Warning: THIS FUNCTION IS DEPRECATED. Please use YoloV2DetectionOutput instead.
*/
REG_OP(YoloV2DetectionOutputD)
.INPUT(coord_data, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(obj_prob, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(classes_prob, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(img_info, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(windex, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(hindex, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(coord_data, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(obj_prob, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(classes_prob, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img_info, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(windex, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(hindex, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(biases, ListFloat)
.ATTR(boxes, Int, 5)
.ATTR(coords, Int, 4)
@@ -663,7 +663,7 @@ REG_OP(YoloV2DetectionOutputD)
.ATTR(score_threshold, Float, 0.5)
.ATTR(iou_threshold, Float, 0.45)
.ATTR(pre_nms_topn, Int, 512)
.OUTPUT(box_out, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(box_out, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(box_out_num, TensorType({DT_INT32}))
.OP_END_FACTORY_REG(YoloV2DetectionOutputD)

@@ -707,16 +707,16 @@ REG_OP(YoloV2DetectionOutputD)
* It is a custom operator. It has no corresponding operator in Caffe.
*/
REG_OP(YoloV3DetectionOutput)
.INPUT(coord_data_low, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(coord_data_mid, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(coord_data_high, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(obj_prob_low, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(obj_prob_mid, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(obj_prob_high, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(classes_prob_low, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(classes_prob_mid, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(classes_prob_high, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(img_info, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(coord_data_low, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(coord_data_mid, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(coord_data_high, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(obj_prob_low, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(obj_prob_mid, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(obj_prob_high, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(classes_prob_low, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(classes_prob_mid, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(classes_prob_high, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img_info, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(biases_low, ListFloat)
.REQUIRED_ATTR(biases_mid, ListFloat)
.REQUIRED_ATTR(biases_high, ListFloat)
@@ -729,7 +729,7 @@ REG_OP(YoloV3DetectionOutput)
.ATTR(score_threshold, Float, 0.5)
.ATTR(iou_threshold, Float, 0.45)
.ATTR(pre_nms_topn, Int, 512)
.OUTPUT(box_out, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(box_out, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(box_out_num, TensorType({DT_INT32}))
.OP_END_FACTORY_REG(YoloV3DetectionOutput)

@@ -776,22 +776,22 @@ s
*Warning: THIS FUNCTION IS DEPRECATED. Please use YoloV3DetectionOutput instead.
*/
REG_OP(YoloV3DetectionOutputD)
.INPUT(coord_data_low, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(coord_data_mid, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(coord_data_high, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(obj_prob_low, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(obj_prob_mid, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(obj_prob_high, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(classes_prob_low, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(classes_prob_mid, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(classes_prob_high, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(img_info, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(windex1, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(windex2, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(windex3, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(hindex1, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(hindex2, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(hindex3, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(coord_data_low, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(coord_data_mid, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(coord_data_high, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(obj_prob_low, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(obj_prob_mid, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(obj_prob_high, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(classes_prob_low, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(classes_prob_mid, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(classes_prob_high, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(img_info, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(windex1, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(windex2, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(windex3, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(hindex1, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(hindex2, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(hindex3, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(biases_low, ListFloat)
.REQUIRED_ATTR(biases_mid, ListFloat)
.REQUIRED_ATTR(biases_high, ListFloat)
@@ -804,7 +804,7 @@ REG_OP(YoloV3DetectionOutputD)
.ATTR(score_threshold, Float, 0.5)
.ATTR(iou_threshold, Float, 0.45)
.ATTR(pre_nms_topn, Int, 512)
.OUTPUT(box_out, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(box_out, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(box_out_num, TensorType({DT_INT32}))
.OP_END_FACTORY_REG(YoloV3DetectionOutputD)

@@ -848,7 +848,7 @@ There are three Yolo operators at Yolov3DetectionOutput's preceding layer on Yol
* It is a custom operator. It has no corresponding operator in Caffe.
*/
REG_OP(YoloV3DetectionOutputV2)
.DYNAMIC_INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT}))
.DYNAMIC_INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(biases, ListFloat)
.ATTR(boxes, Int, 3)
.ATTR(coords, Int, 4)
@@ -862,7 +862,7 @@ REG_OP(YoloV3DetectionOutputV2)
.ATTR(N, Int, 10)
.ATTR(resize_origin_img_to_net, Bool, false)
.ATTR(out_box_dim, Int, 3)
.OUTPUT(box_out, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(box_out, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(box_out_num, TensorType({DT_INT32}))
.OP_END_FACTORY_REG(YoloV3DetectionOutputV2)

@@ -910,9 +910,9 @@ REG_OP(YoloV3DetectionOutputV2)
* Warning: THIS FUNCTION IS DEPRECATED. Please use YoloV3DetectionOutputV2 instead.
*/
REG_OP(YoloV3DetectionOutputV2D)
.DYNAMIC_INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT}))
.DYNAMIC_INPUT(windex, TensorType({DT_FLOAT16,DT_FLOAT}))
.DYNAMIC_INPUT(hindex, TensorType({DT_FLOAT16,DT_FLOAT}))
.DYNAMIC_INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.DYNAMIC_INPUT(windex, TensorType({DT_FLOAT16, DT_FLOAT}))
.DYNAMIC_INPUT(hindex, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(biases, ListFloat)
.ATTR(boxes, Int, 3)
.ATTR(coords, Int, 4)
@@ -926,7 +926,7 @@ REG_OP(YoloV3DetectionOutputV2D)
.ATTR(N, Int, 10)
.ATTR(resize_origin_img_to_net, Bool, false)
.ATTR(out_box_dim, Int, 3)
.OUTPUT(box_out, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(box_out, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(box_out_num, TensorType({DT_INT32}))
.OP_END_FACTORY_REG(YoloV3DetectionOutputV2D)

@@ -1466,9 +1466,9 @@ REG_OP(NormalizeBBox)
* y: A Tensor. Must have the same type as box_predictions.
*/
REG_OP(DecodeBboxV2)
.INPUT(boxes, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(anchors, TensorType({DT_FLOAT16,DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16,DT_FLOAT}))
.INPUT(boxes, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(anchors, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.ATTR(scales, ListFloat, {1.0, 1.0, 1.0, 1.0})
.ATTR(decode_clip, Float, 0.0)
.ATTR(reversed_box, Bool, false)
@@ -1592,7 +1592,6 @@ selected indices from the boxes tensor, where M <= max_output_size. \n
*Compatible with onnx NonMaxSuppression operator.
*/


REG_OP(NonMaxSuppressionV7)
.INPUT(boxes, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(scores, TensorType({DT_FLOAT16, DT_FLOAT}))
@@ -1641,7 +1640,7 @@ REG_OP(RoiExtractor)
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.ATTR(finest_scale, Int, 56)
.ATTR(roi_scale_factor, Float, 0)
.ATTR(spatial_scale, ListFloat, { 1.f/4, 1.f/8, 1.f/16, 1.f/32 })
.ATTR(spatial_scale, ListFloat, {1.f / 4, 1.f / 8, 1.f / 16, 1.f / 32})
.ATTR(pooled_height, Int, 7)
.ATTR(pooled_width, Int, 7)
.ATTR(sample_num, Int, 0)
@@ -1649,6 +1648,84 @@ REG_OP(RoiExtractor)
.ATTR(aligned, Bool, true)
.OP_END_FACTORY_REG(RoiExtractor)

/**
*@brief Performs Position Sensitive PS ROI Pooling . \n

*@par Inputs:
* Two inputs, including:
*@li x: An NC1HWC0 tensor of type float16 or float32, describing the feature
* map, dimension C1 must be equal to
* (int(output_dim+15)/C0))*group_size*group_size.
*@li rois: A tensor of type float16 or float32, with shape
* [batch, 5, rois_num], describing the ROIs, each ROI consists of five
* elements: "batch_id", "x1", "y1", "x2", and "y2", which "batch_id" indicates
* the index of the input feature map, "x1", "y1", "x2", or "y2" must be
* greater than or equal to "0.0" . \n

*@par Attributes:
*@li output_dim: A required int32, specifying the number of output channels,
* must be greater than 0.
*@li group_size: A required int32, specifying the number of groups to encode
* position-sensitive score maps, must be within the range (0, 128).
*@li spatial_scale: A required float32, scaling factor for mapping the input
* coordinates to the ROI coordinates . \n

*@par Outputs:
*y: An NC1HWC0 tensor of type float16 or float32, describing the result
* feature map . \n

*@attention Constraints:
* HC1HWC0: channel must be Group_size squared, rois_num is a multiple of 16
*/
REG_OP(PSROIPoolingV2)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(rois, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(spatial_scale, Float)
.REQUIRED_ATTR(output_dim, Int)
.REQUIRED_ATTR(group_size, Int)
.OP_END_FACTORY_REG(PSROIPoolingV2)

/**
*@brief Performs Position Sensitive PS ROI Pooling Grad . \n

*@par Inputs:
* Two inputs, including:
*@li x: An NC1HWC0 tensor of type float16 or float32, describing the result
* feature map . \n
*@li rois: A tensor of type float16 or float32, with shape
* [batch, 5, rois_num], describing the ROIs, each ROI consists of five
* elements: "batch_id", "x1", "y1", "x2", and "y2", which "batch_id" indicates
* the index of the input feature map, "x1", "y1", "x2", or "y2" must be
* greater than or equal to "0.0" . \n

*@par Attributes:
*@li output_dim: A required int32, specifying the number of output channels,
* must be greater than 0.
*@li group_size: A required int32, specifying the number of groups to encode
* position-sensitive score maps, must be within the range (0, 128).
*@li spatial_scale: A required float32, scaling factor for mapping the input
* coordinates to the ROI coordinates . \n
*@li input_size: A required listInt, mapping the gradinput size: (H, W)

*@par Outputs:
*y: An NC1HWC0 tensor of type float16 or float32, describing the feature
* map, dimension C1 must be equal to
* (int(output_dim+15)/C0))*group_size*group_size.

*@attention Constraints:
* HC1HWC0: channel must be Group_size squared, rois_num is a multiple of 16
*/
REG_OP(PSROIPoolingGradV2D)
.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
.INPUT(rois, TensorType({DT_FLOAT16, DT_FLOAT}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
.REQUIRED_ATTR(spatial_scale, Float)
.REQUIRED_ATTR(output_dim, Int)
.REQUIRED_ATTR(group_size, Int)
.REQUIRED_ATTR(input_size, ListInt)
.OP_END_FACTORY_REG(PSROIPoolingGradV2D)

} // namespace ge

#endif // OPS_BUILT_IN_OP_PROTO_INC_NN_DETECT_OPS_H_

+ 25
- 0
third_party/fwkacllib/inc/ops/nn_norm_ops.h View File

@@ -526,6 +526,31 @@ REG_OP(LayerNorm)
.OP_END_FACTORY_REG(LayerNorm)

/**
*@brief Returns a tensor where each sub-tensor of input along dimension
* dim is normalized such that the p-norm of the sub-tensor is lower than the value maxnorm. \n

*@par Inputs:
*One input, including:
* @li x: A Tensor. Must be one of the following types: float16, float32 . \n

*@par Attributes:
* @li p: Specify L_p norm, the type is float.
* @li dim: The processed dim, the type is int.
* @li maxnorm: Threshold for comparison, the type is float. \n

*@par Outputs:
*One outputs, including:
* @li y: shape and dtype of output, should be same shape and type as input.
*/
REG_OP(Renorm)
.INPUT(x, TensorType::BasicType())
.OUTPUT(y, TensorType::BasicType())
.REQUIRED_ATTR(p, Float)
.REQUIRED_ATTR(dim, Int)
.REQUIRED_ATTR(maxnorm, Float)
.OP_END_FACTORY_REG(Renorm)

/**
*@brief LayerNormGrad operator interface implementation
* calculating: dy, x, variance, mean, gamma
* pd_xl = data_dy*data_gamma


+ 4
- 4
third_party/fwkacllib/inc/ops/nn_pooling_ops.h View File

@@ -397,8 +397,8 @@ No default value.
specifying the stride of the sliding window for each dimension of
the input tensor. No default value.
*@li padding: A required string type of float16.
*@li pads: A list type of int32. Default value {0, 0, 0}.
*@li dilation: A list type of int32. Default value {1, 1, 1}.
*@li pads: A list type of int32. Default value {0,0,0,0,0,0}.
*@li dilation: A list type of int32. Default value {1,1,1,1,1,1}.
*@li ceil_mode: A ceil mode number of int32 . Default value 0.
*@li data_format: An optional string. Defaults to "NDHWC" . \n

@@ -421,8 +421,8 @@ REG_OP(MaxPool3D)
.REQUIRED_ATTR(ksize, ListInt)
.REQUIRED_ATTR(strides, ListInt)
.REQUIRED_ATTR(padding, String)
.ATTR(pads, ListInt, {0,0,0})
.ATTR(dilation, ListInt, {1,1,1})
.ATTR(pads, ListInt, {0,0,0,0,0,0})
.ATTR(dilation, ListInt, {1,1,1,1,1,1})
.ATTR(ceil_mode, Int, 0)
.ATTR(data_format, String, "NDHWC")
.OP_END_FACTORY_REG(MaxPool3D)


+ 2
- 2
third_party/fwkacllib/inc/ops/pad_ops.h View File

@@ -418,7 +418,7 @@ REG_OP(EmbeddingRankId)
*/
REG_OP(FillV2)
.INPUT(dims, TensorType({DT_INT16, DT_INT32, DT_INT64}))
.OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT, DT_DOUBLE, DT_INT8, DT_INT16, DT_INT32, DT_INT64}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT8, DT_INT16, DT_INT32, DT_INT64}))
.ATTR(value, Float, 0)
.OP_END_FACTORY_REG(FillV2)

@@ -437,7 +437,7 @@ REG_OP(FillV2)
* Compatible with the ONNX operator ConstantOfShape.
*/
REG_OP(FillV2D)
.OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT, DT_DOUBLE, DT_INT8, DT_UINT8, DT_INT16, DT_INT32, DT_INT64}))
.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT8, DT_UINT8, DT_INT16, DT_INT32, DT_INT64}))
.ATTR(value, Float, 0)
.REQUIRED_ATTR(dims, ListInt)
.OP_END_FACTORY_REG(FillV2D)


Loading…
Cancel
Save