:gitee_url: https://gitee.com/mindspore/docs .. _program_listing_file_include_execute.h: Program Listing for File execute.h ================================== |exhale_lsh| :ref:`Return to documentation for file ` (``include/execute.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_DATASET_EXECUTE_H_ #define MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_DATASET_EXECUTE_H_ #include #include #include #include #include "include/api/context.h" #include "include/api/types.h" #include "include/dataset/constants.h" #include "include/dataset/transforms.h" namespace mindspore { namespace dataset { class DeviceResource; // class to run tensor operations in eager mode class Execute { public: explicit Execute(std::shared_ptr op, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0); explicit Execute(std::shared_ptr op, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0); explicit Execute(std::reference_wrapper op, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0); explicit Execute(TensorTransform *op, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0); explicit Execute(std::vector> ops, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0); explicit Execute(std::vector> ops, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0); explicit Execute(const std::vector> ops, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0); explicit Execute(const std::vector &ops, MapTargetDevice device_type = MapTargetDevice::kCpu, uint32_t device_id = 0); ~Execute(); Status operator()(const mindspore::MSTensor &input, mindspore::MSTensor *output); Status operator()(const std::vector &input_tensor_list, std::vector *out); Status DeviceMemoryRelease(); std::string AippCfgGenerator(); private: Status ParseTransforms(); Status ValidateDevice(); Status InitResource(MapTargetDevice device_type, uint32_t device_id); std::vector> transforms_; std::vector> ops_; MapTargetDevice device_type_; std::shared_ptr device_resource_; struct ExtraInfo; std::shared_ptr info_; }; } // namespace dataset } // namespace mindspore #endif // MINDSPORE_CCSRC_MINDDATA_DATASET_INCLUDE_DATASET_EXECUTE_H_