Merged
docs: 修复注释与代码不一致(HistogramV2 dtype 属性说明) #6494
docs: 修复注释与代码不一致(HistogramV2 dtype 属性说明) #6494
Merged
TangPCAdd on Oct 19
Total: 2 files changed+2-2
@@ -23,7 +23,7 @@
23 * - Histogram: min/max are attributes23 * - Histogram: min/max are attributes
24 * - HistogramV2: min/max are input tensors24 * - HistogramV2: min/max are input tensors
25 * - min/max tensors dtype should match x's dtype25 * - min/max tensors dtype should match x's dtype
26- * - is_out_dtype_int32 attr depends on x dtype (false for float/f16)26+ * - y_dtype attr is selected from x dtype (DT_FLOAT for float/f16)
27 */27 */
28 28 
29#include <vector>29#include <vector>
@@ -24,7 +24,7 @@ static ge::graphStatus HistogramV2InferDataTypeFunc(gert::InferDataTypeContext*
24 auto inputDtype = context->GetInputDataType(0);24 auto inputDtype = context->GetInputDataType(0);
25 OP_LOGD(context, "x dtype: %s", Ops::Base::ToString(inputDtype).c_str());25 OP_LOGD(context, "x dtype: %s", Ops::Base::ToString(inputDtype).c_str());
26 26 
27- // y_dtype属性指定输出类型,默认为DT_INT32(3),可设置为DT_FLOAT(9)27+ // y_dtype属性指定输出类型,默认为DT_INT32(3),可设置为DT_FLOAT(0)
28 auto attrs = context->GetAttrs();28 auto attrs = context->GetAttrs();
29 ge::DataType outDtype = ge::DT_INT32;29 ge::DataType outDtype = ge::DT_INT32;
30 if (attrs != nullptr) {30 if (attrs != nullptr) {