blace.ai
blace::ops::PrepareForHostCopyOP Class Reference

#include <public_ops.h>

Inheritance diagram for blace::ops::PrepareForHostCopyOP:

Public Member Functions

 PrepareForHostCopyOP (OpP input, ml_core::DataTypeEnum data_type, ml_core::ColorFormatEnum color_format, ml_core::OrderEnum tensor_order, ml_core::ValueRangeEnum value_range, ml_core::DeviceEnum device)
 

Detailed Description

Operator to prepare tensor for copying to host.

Constructor & Destructor Documentation

◆ PrepareForHostCopyOP()

blace::ops::PrepareForHostCopyOP::PrepareForHostCopyOP ( OpP  input,
ml_core::DataTypeEnum  data_type,
ml_core::ColorFormatEnum  color_format,
ml_core::OrderEnum  tensor_order,
ml_core::ValueRangeEnum  value_range,
ml_core::DeviceEnum  device 
)

Prepares a the internal tensor for copying to host by making sure all meta data (type, ordering, sizes etc.) are aligned.

This needs to be used together with GraphEvaluator::evaluateToRawMemory() often. E.g. a cv::Mat will expect BGR color in a HWC tensor.

Parameters
input
data_typeThe desired datatype.
color_formatTarget color format.
tensor_orderTarget tensor order.
value_rangeTarget value range.
devicePut on device.