diff --git a/inc/external/acl/error_codes/rt_error_codes.h b/inc/external/acl/error_codes/rt_error_codes.h index daeca17c..05122efb 100644 --- a/inc/external/acl/error_codes/rt_error_codes.h +++ b/inc/external/acl/error_codes/rt_error_codes.h @@ -64,49 +64,54 @@ static const int32_t ACL_ERROR_RT_QUEUE_EMPTY = 207013; // queue is emp static const int32_t ACL_ERROR_RT_QUEUE_FULL = 207014; // queue is full static const int32_t ACL_ERROR_RT_REPEATED_INIT = 207015; // repeated init static const int32_t ACL_ERROR_RT_AIVEC_OVER_FLOW = 207016; // aivec over flow +static const int32_t ACL_ERROR_RT_OVER_FLOW = 207017; // common over flow -static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error -static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error -static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream -static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream -static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete -static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence -static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete -static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error -static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error -static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support -static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat -static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed -static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout -static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error -static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout -static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception -static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception -static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout -static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception -static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error -static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error -static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error -static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error -static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal -static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering -static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init -static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data -static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error -static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate -static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed -static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed -static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context -static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out -static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error -static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout -static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception -static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception -static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal -static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode -static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die -static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id -static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set +static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error +static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error +static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream +static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream +static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete +static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence +static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete +static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error +static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error +static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support +static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat +static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed +static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout +static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error +static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout +static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception +static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception +static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout +static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception +static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error +static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error +static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error +static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error +static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal +static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering +static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init +static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data +static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error +static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate +static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed +static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed +static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context +static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out +static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error +static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout +static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception +static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception +static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal +static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode +static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die +static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id +static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set +static const int32_t ACL_ERROR_RT_AICORE_TRAP_READ_OVERFLOW = 507042; // aic trap read overflow +static const int32_t ACL_ERROR_RT_AICORE_TRAP_WRITE_OVERFLOW = 507043; // aic trap write overflow +static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_READ_OVERFLOW = 507044; // aiv trap read overflow +static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_WRITE_OVERFLOW = 507045; // aiv trap write overflow static const int32_t ACL_ERROR_RT_DRV_INTERNAL_ERROR = 507899; // drv internal error static const int32_t ACL_ERROR_RT_AICPU_INTERNAL_ERROR = 507900; // aicpu internal error diff --git a/inc/external/ge/ge_api_types.h b/inc/external/ge/ge_api_types.h index 8ed1174c..7f3bf5c0 100644 --- a/inc/external/ge/ge_api_types.h +++ b/inc/external/ge/ge_api_types.h @@ -71,13 +71,15 @@ const char_t *const OPTION_EXEC_DYNAMIC_EXECUTE_MODE = "ge.exec.dynamicGraphExec const char_t *const OPTION_EXEC_DATA_INPUTS_SHAPE_RANGE = "ge.exec.dataInputsShapeRange"; const char_t *const OPTION_EXEC_ENABLE_COPY_OUTPUT_ADDR = "ge.exec.enableCopyOutputAddr"; const char_t *const OPTION_EXEC_GRAPH_EXEC_TIMEOUT = "ge.exec.graphExecTimeout"; -const char_t *const OPTION_EXEC_MODEL_EXEC_TIMEOUT = "ge.exec.modelExecTimeout"; // Option key: memory init const char_t *const GRAPH_MEMORY_MAX_SIZE = "ge.graphMemoryMaxSize"; const char_t *const VARIABLE_MEMORY_MAX_SIZE = "ge.variableMemoryMaxSize"; const char_t *const OPTION_EXEC_REUSE_ZERO_COPY_MEMORY = "ge.exec.reuseZeroCopyMemory"; +const char_t *const OPTION_EXEC_LOGICAL_DEVICE_CLUSTER_DEPLOY_MODE = "ge.exec.logicalDeviceClusterDeployMode"; +const char_t *const OPTION_EXEC_LOGICAL_DEVICE_ID = "ge.exec.logicalDeviceId"; + namespace configure_option { const char_t *const STREAM_NUM = "ge.streamNum"; const char_t *const HEAD_STREAM = "ge.headStream"; @@ -107,6 +109,7 @@ const char_t *const OPTYPELIST_FOR_IMPLMODE = "ge.optypelistForImplmode"; const char_t *const HCOM_PARALLEL = "ge.hcomParallel"; const char_t *const AUTO_TUNE_MODE = "ge.autoTuneMode"; const char_t *const SOC_VERSION = "ge.socVersion"; +const char_t *const VIRTUAL_TYPE = "ge.virtual_type"; const char_t *const CORE_TYPE = "ge.engineType"; const char_t *const AICORE_NUM = "ge.aicoreNum"; const char_t *const L1_FUSION = "ge.l1Fusion"; @@ -254,9 +257,16 @@ const std::string AUTO_TUNE_MODE = "ge.autoTuneMode"; // Configure soc version , example: "Ascend310" const std::string SOC_VERSION = "ge.socVersion"; +// configure whether to enable virtualization, +// its value should be "0" or "1", default value is "0" +const std::string VIRTUAL_TYPE = "ge.virtual_type"; + // Configure core type "VectorEngine", default value is "AIcoreEngine" const std::string CORE_TYPE = "ge.engineType"; +// Configure graph exclude one or more engines +const std::string EXCLUDE_ENGINES = "ge.exec.exclude_engines"; + // Configure AICORE NUM const std::string AICORE_NUM = "ge.aicoreNum"; @@ -420,6 +430,7 @@ static const char_t *const EXEC_DISABLE_REUSED_MEMORY = ge::OPTION_EXEC_DISABLE_ static const char_t *const AUTO_TUNE_MODE = ge::AUTO_TUNE_MODE.c_str(); static const char_t *const CORE_TYPE = ge::CORE_TYPE.c_str(); static const char_t *const SOC_VERSION = ge::SOC_VERSION.c_str(); +static const char_t *const VIRTUAL_TYPE = ge::VIRTUAL_TYPE.c_str(); static const char_t *const ENABLE_SINGLE_STREAM = ge::ENABLE_SINGLE_STREAM; static const char_t *const AICORE_NUM = ge::AICORE_NUM.c_str(); static const char_t *const FUSION_SWITCH_FILE = ge::FUSION_SWITCH_FILE.c_str(); @@ -487,6 +498,7 @@ const std::set ir_parser_suppported_options = { // for interface: aclgrphBuildInitialize const std::set global_options = {CORE_TYPE, SOC_VERSION, + VIRTUAL_TYPE, BUFFER_OPTIMIZE, ENABLE_COMPRESS_WEIGHT, COMPRESS_WEIGHT_CONF, diff --git a/inc/external/runtime/rt_error_codes.h b/inc/external/runtime/rt_error_codes.h index daeca17c..05122efb 100644 --- a/inc/external/runtime/rt_error_codes.h +++ b/inc/external/runtime/rt_error_codes.h @@ -64,49 +64,54 @@ static const int32_t ACL_ERROR_RT_QUEUE_EMPTY = 207013; // queue is emp static const int32_t ACL_ERROR_RT_QUEUE_FULL = 207014; // queue is full static const int32_t ACL_ERROR_RT_REPEATED_INIT = 207015; // repeated init static const int32_t ACL_ERROR_RT_AIVEC_OVER_FLOW = 207016; // aivec over flow +static const int32_t ACL_ERROR_RT_OVER_FLOW = 207017; // common over flow -static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error -static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error -static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream -static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream -static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete -static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence -static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete -static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error -static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error -static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support -static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat -static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed -static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout -static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error -static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout -static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception -static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception -static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout -static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception -static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error -static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error -static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error -static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error -static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal -static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering -static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init -static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data -static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error -static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate -static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed -static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed -static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context -static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out -static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error -static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout -static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception -static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception -static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal -static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode -static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die -static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id -static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set +static const int32_t ACL_ERROR_RT_INTERNAL_ERROR = 507000; // runtime internal error +static const int32_t ACL_ERROR_RT_TS_ERROR = 507001; // ts internel error +static const int32_t ACL_ERROR_RT_STREAM_TASK_FULL = 507002; // task full in stream +static const int32_t ACL_ERROR_RT_STREAM_TASK_EMPTY = 507003; // task empty in stream +static const int32_t ACL_ERROR_RT_STREAM_NOT_COMPLETE = 507004; // stream not complete +static const int32_t ACL_ERROR_RT_END_OF_SEQUENCE = 507005; // end of sequence +static const int32_t ACL_ERROR_RT_EVENT_NOT_COMPLETE = 507006; // event not complete +static const int32_t ACL_ERROR_RT_CONTEXT_RELEASE_ERROR = 507007; // context release error +static const int32_t ACL_ERROR_RT_SOC_VERSION = 507008; // soc version error +static const int32_t ACL_ERROR_RT_TASK_TYPE_NOT_SUPPORT = 507009; // task type not support +static const int32_t ACL_ERROR_RT_LOST_HEARTBEAT = 507010; // ts lost heartbeat +static const int32_t ACL_ERROR_RT_MODEL_EXECUTE = 507011; // model execute failed +static const int32_t ACL_ERROR_RT_REPORT_TIMEOUT = 507012; // report timeout +static const int32_t ACL_ERROR_RT_SYS_DMA = 507013; // sys dma error +static const int32_t ACL_ERROR_RT_AICORE_TIMEOUT = 507014; // aicore timeout +static const int32_t ACL_ERROR_RT_AICORE_EXCEPTION = 507015; // aicore exception +static const int32_t ACL_ERROR_RT_AICORE_TRAP_EXCEPTION = 507016; // aicore trap exception +static const int32_t ACL_ERROR_RT_AICPU_TIMEOUT = 507017; // aicpu timeout +static const int32_t ACL_ERROR_RT_AICPU_EXCEPTION = 507018; // aicpu exception +static const int32_t ACL_ERROR_RT_AICPU_DATADUMP_RSP_ERR = 507019; // aicpu datadump response error +static const int32_t ACL_ERROR_RT_AICPU_MODEL_RSP_ERR = 507020; // aicpu model operate response error +static const int32_t ACL_ERROR_RT_PROFILING_ERROR = 507021; // profiling error +static const int32_t ACL_ERROR_RT_IPC_ERROR = 507022; // ipc error +static const int32_t ACL_ERROR_RT_MODEL_ABORT_NORMAL = 507023; // model abort normal +static const int32_t ACL_ERROR_RT_KERNEL_UNREGISTERING = 507024; // kernel unregistering +static const int32_t ACL_ERROR_RT_RINGBUFFER_NOT_INIT = 507025; // ringbuffer not init +static const int32_t ACL_ERROR_RT_RINGBUFFER_NO_DATA = 507026; // ringbuffer no data +static const int32_t ACL_ERROR_RT_KERNEL_LOOKUP = 507027; // kernel lookup error +static const int32_t ACL_ERROR_RT_KERNEL_DUPLICATE = 507028; // kernel register duplicate +static const int32_t ACL_ERROR_RT_DEBUG_REGISTER_FAIL = 507029; // debug register failed +static const int32_t ACL_ERROR_RT_DEBUG_UNREGISTER_FAIL = 507030; // debug unregister failed +static const int32_t ACL_ERROR_RT_LABEL_CONTEXT = 507031; // label not in current context +static const int32_t ACL_ERROR_RT_PROGRAM_USE_OUT = 507032; // program register num use out +static const int32_t ACL_ERROR_RT_DEV_SETUP_ERROR = 507033; // device setup error +static const int32_t ACL_ERROR_RT_VECTOR_CORE_TIMEOUT = 507034; // vector core timeout +static const int32_t ACL_ERROR_RT_VECTOR_CORE_EXCEPTION = 507035; // vector core exception +static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_EXCEPTION = 507036; // vector core trap exception +static const int32_t ACL_ERROR_RT_CDQ_BATCH_ABNORMAL = 507037; // cdq alloc batch abnormal +static const int32_t ACL_ERROR_RT_DIE_MODE_CHANGE_ERROR = 507038; // can not change die mode +static const int32_t ACL_ERROR_RT_DIE_SET_ERROR = 507039; // single die mode can not set die +static const int32_t ACL_ERROR_RT_INVALID_DIEID = 507040; // invalid die id +static const int32_t ACL_ERROR_RT_DIE_MODE_NOT_SET = 507041; // die mode not set +static const int32_t ACL_ERROR_RT_AICORE_TRAP_READ_OVERFLOW = 507042; // aic trap read overflow +static const int32_t ACL_ERROR_RT_AICORE_TRAP_WRITE_OVERFLOW = 507043; // aic trap write overflow +static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_READ_OVERFLOW = 507044; // aiv trap read overflow +static const int32_t ACL_ERROR_RT_VECTOR_CORE_TRAP_WRITE_OVERFLOW = 507045; // aiv trap write overflow static const int32_t ACL_ERROR_RT_DRV_INTERNAL_ERROR = 507899; // drv internal error static const int32_t ACL_ERROR_RT_AICPU_INTERNAL_ERROR = 507900; // aicpu internal error diff --git a/inc/framework/common/debug/ge_log.h b/inc/framework/common/debug/ge_log.h index 2cb56222..aff56d4f 100644 --- a/inc/framework/common/debug/ge_log.h +++ b/inc/framework/common/debug/ge_log.h @@ -17,6 +17,7 @@ #ifndef INC_FRAMEWORK_COMMON_DEBUG_GE_LOG_H_ #define INC_FRAMEWORK_COMMON_DEBUG_GE_LOG_H_ +#include #include #include "framework/common/ge_inner_error_codes.h" @@ -56,63 +57,64 @@ inline bool IsLogEnable(const int32_t module_name, const int32_t log_level) { return (enable == 1); } -#define GELOGE(ERROR_CODE, fmt, ...) \ - do { \ - dlog_error(GE_MODULE_NAME, "%lu %s: ErrorNo: %u(%s) %s" fmt, GeLog::GetTid(), &__FUNCTION__[0], (ERROR_CODE), \ - ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), ErrorManager::GetInstance().GetLogHeader().c_str(), \ - ##__VA_ARGS__); \ +#define GELOGE(ERROR_CODE, fmt, ...) \ + do { \ + dlog_error(GE_MODULE_NAME, "%" PRIu64 " %s: ErrorNo: %" PRIuLEAST8 "(%s) %s" fmt, GeLog::GetTid(), \ + &__FUNCTION__[0], (ERROR_CODE), ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), \ + ErrorManager::GetInstance().GetLogHeader().c_str(), ##__VA_ARGS__); \ } while (false) -#define GELOGW(fmt, ...) \ - do { \ - if (IsLogEnable(GE_MODULE_NAME, DLOG_WARN)) { \ - dlog_warn(GE_MODULE_NAME, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ - } \ +#define GELOGW(fmt, ...) \ + do { \ + if (IsLogEnable(GE_MODULE_NAME, DLOG_WARN)) { \ + dlog_warn(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ + } \ } while (false) -#define GELOGI(fmt, ...) \ - do { \ - if (IsLogEnable(GE_MODULE_NAME, DLOG_INFO)) { \ - dlog_info(GE_MODULE_NAME, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ - } \ +#define GELOGI(fmt, ...) \ + do { \ + if (IsLogEnable(GE_MODULE_NAME, DLOG_INFO)) { \ + dlog_info(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ + } \ } while (false) -#define GELOGD(fmt, ...) \ - do { \ - if (IsLogEnable(GE_MODULE_NAME, DLOG_DEBUG)) { \ - dlog_debug(GE_MODULE_NAME, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ - } \ +#define GELOGD(fmt, ...) \ + do { \ + if (IsLogEnable(GE_MODULE_NAME, DLOG_DEBUG)) { \ + dlog_debug(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ + } \ } while (false) -#define GEEVENT(fmt, ...) \ - do { \ - dlog_event(GE_MODULE_NAME, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ +#define GEEVENT(fmt, ...) \ + do { \ + dlog_event(GE_MODULE_NAME, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ } while (false) -#define GELOGT(VALUE, fmt, ...) \ - do { \ - TraceStatus stat = (VALUE); \ - const char_t *const TraceStatStr[] = {"INIT", "RUNNING", "WAITING", "STOP"}; \ - const int32_t idx = static_cast(stat); \ - char_t *k = const_cast("status"); \ - char_t *v = const_cast(TraceStatStr[idx]); \ - KeyValue kv = {k, v}; \ - DlogWithKV(GE_MODULE_NAME, DLOG_TRACE, &kv, 1, "%lu %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], ##__VA_ARGS__); \ +#define GELOGT(VALUE, fmt, ...) \ + do { \ + TraceStatus stat = (VALUE); \ + const char_t *const TraceStatStr[] = {"INIT", "RUNNING", "WAITING", "STOP"}; \ + const int32_t idx = static_cast(stat); \ + char_t *k = const_cast("status"); \ + char_t *v = const_cast(TraceStatStr[idx]); \ + KeyValue kv = {k, v}; \ + DlogWithKV(GE_MODULE_NAME, DLOG_TRACE, &kv, 1, "%" PRIu64 " %s:" fmt, GeLog::GetTid(), &__FUNCTION__[0], \ + ##__VA_ARGS__); \ } while (false) -#define GE_LOG_ERROR(MOD_NAME, ERROR_CODE, fmt, ...) \ - do { \ - dlog_error((MOD_NAME), "%lu %s: ErrorNo: %u(%s) %s" fmt, GeLog::GetTid(), &__FUNCTION__[0], (ERROR_CODE), \ - ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), ErrorManager::GetInstance().GetLogHeader().c_str(), \ - ##__VA_ARGS__); \ +#define GE_LOG_ERROR(MOD_NAME, ERROR_CODE, fmt, ...) \ + do { \ + dlog_error((MOD_NAME), "%" PRIu64 " %s: ErrorNo: %" PRIuLEAST8 "(%s) %s" fmt, GeLog::GetTid(), &__FUNCTION__[0], \ + (ERROR_CODE), ((GE_GET_ERRORNO_STR(ERROR_CODE)).c_str()), \ + ErrorManager::GetInstance().GetLogHeader().c_str(), ##__VA_ARGS__); \ } while (false) // print memory when it is greater than 1KB. -#define GE_PRINT_DYNAMIC_MEMORY(FUNC, PURPOSE, SIZE) \ - do { \ - if (static_cast(SIZE) > 1024UL) { \ - GELOGI("MallocMemory, func=%s, size=%zu, purpose=%s", (#FUNC), static_cast(SIZE), (PURPOSE)); \ - } \ +#define GE_PRINT_DYNAMIC_MEMORY(FUNC, PURPOSE, SIZE) \ + do { \ + if (static_cast(SIZE) > 1024UL) { \ + GELOGI("MallocMemory, func=%s, size=%" PRIu64 ", purpose=%s", (#FUNC), static_cast(SIZE), (PURPOSE)); \ + } \ } while (false) #ifdef __cplusplus } diff --git a/inc/framework/common/debug/log.h b/inc/framework/common/debug/log.h index 1f755faa..45c157f3 100644 --- a/inc/framework/common/debug/log.h +++ b/inc/framework/common/debug/log.h @@ -180,13 +180,13 @@ #define GE_ERRORLOG_AND_ERRORMSG(_status, errormsg) \ { \ GELOGE((_status), "[Check][InnerData]%s", (errormsg)); \ - REPORT_INNER_ERROR("E19999", "%s", (errormsg)); \ + REPORT_INNER_ERROR("E10052", "%s", (errormsg)); \ } #define GE_WARNINGLOG_AND_ERRORMSG(errormsg) \ { \ GELOGW("%s", (errormsg)); \ - ErrorManager::GetInstance().ATCReportErrMessage("E19021", {"reason"}, {(errormsg)}); \ + ErrorManager::GetInstance().ATCReportErrMessage("E10052", {"reason"}, {(errormsg)}); \ } #define GE_CHK_LOG_AND_ERRORMSG(expr, _status, errormsg) \ @@ -194,7 +194,7 @@ const bool b = (expr); \ if (!b) { \ GELOGE((_status), "%s", (errormsg)); \ - ErrorManager::GetInstance().ATCReportErrMessage("E19021", {"reason"}, {(errormsg)}); \ + ErrorManager::GetInstance().ATCReportErrMessage("E10052", {"reason"}, {(errormsg)}); \ return (_status); \ } \ } while (false) diff --git a/inc/framework/common/op_types.h b/inc/framework/common/op_types.h index 12123925..94a6b977 100644 --- a/inc/framework/common/op_types.h +++ b/inc/framework/common/op_types.h @@ -31,8 +31,8 @@ class GE_FUNC_VISIBILITY OpTypeContainer { } ~OpTypeContainer() = default; - void Register(const std::string &op_type) { - static_cast(op_type_list_.insert(op_type)); + bool Register(const std::string &op_type) { + return op_type_list_.insert(op_type).second; } bool IsExisting(const std::string &op_type) { @@ -52,7 +52,7 @@ class GE_FUNC_VISIBILITY OpTypeContainer { #define REGISTER_OPTYPE_DEFINE(var_name, str_name) \ const char_t *var_name = str_name; \ - const bool g_##var_name##_reg = (static_cast(OpTypeContainer::Instance()->Register(str_name)), true); + const bool g_##var_name##_reg = OpTypeContainer::Instance()->Register(str_name); #define IS_OPTYPE_EXISTING(str_name) (ge::OpTypeContainer::Instance()->IsExisting(str_name)) #endif // INC_FRAMEWORK_COMMON_OP_TYPES_H_ diff --git a/inc/framework/common/types.h b/inc/framework/common/types.h index ac2c0fde..ab5218c0 100644 --- a/inc/framework/common/types.h +++ b/inc/framework/common/types.h @@ -162,6 +162,7 @@ REGISTER_OPTYPE_DECLARE(_IF, "_If"); REGISTER_OPTYPE_DECLARE(STATELESSIF, "StatelessIf"); REGISTER_OPTYPE_DECLARE(IF, "If"); REGISTER_OPTYPE_DECLARE(CASE, "Case"); +REGISTER_OPTYPE_DECLARE(STATELESSCASE, "StatelessCase"); REGISTER_OPTYPE_DECLARE(_WHILE, "_While"); REGISTER_OPTYPE_DECLARE(WHILE, "While"); REGISTER_OPTYPE_DECLARE(STATELESSWHILE, "StatelessWhile"); @@ -626,8 +627,8 @@ struct ModelFileHeader { uint32_t version = MODEL_VERSION; // version 1.0 uint8_t checksum[MODEL_FILE_CHECKSUM_LENGTH] = {0U}; // signature uint32_t length = 0U; // Ciphertext length. In the non-encryption model, the length is the plaintext length. - uint8_t is_encrypt = - static_cast(ModelEncryptType::UNENCRYPTED); // whether encrypted 0:not encrypt, 1:encrypt + // whether encrypted 0:not encrypt, 1:encrypt + uint8_t is_encrypt = static_cast(ModelEncryptType::UNENCRYPTED); uint8_t is_checksum = static_cast(ModelCheckType::CHECK); // whether to check the checksum uint8_t modeltype = 0U; // 0:IR model 1:standard model 2: OM Tiny model uint8_t genmode = 0U; // 0:offline generate 1:online generate diff --git a/inc/framework/engine/dnnengine.h b/inc/framework/engine/dnnengine.h index 63c2d9de..f9a7b65b 100644 --- a/inc/framework/engine/dnnengine.h +++ b/inc/framework/engine/dnnengine.h @@ -31,6 +31,7 @@ enum class PriorityEnum { COST_1 = 1, COST_2 = 2, COST_3 = 3, + COST_4 = 4, COST_9 = 9, COST_10 = 10, }; diff --git a/inc/framework/executor/ge_executor.h b/inc/framework/executor/ge_executor.h index a3f7cea1..3c921345 100644 --- a/inc/framework/executor/ge_executor.h +++ b/inc/framework/executor/ge_executor.h @@ -178,7 +178,7 @@ class GE_FUNC_VISIBILITY GeExecutor { Status GetAippType(const uint32_t model_id, const uint32_t index, InputAippType &type, size_t &aipp_index); - Status CommandHandle(const Command &command); + Status CommandHandle(const Command &command) const; Status SetDump(const DumpConfig &dump_config); diff --git a/inc/framework/omg/parser/parser_types.h b/inc/framework/omg/parser/parser_types.h index a2452c65..c1e94a4c 100644 --- a/inc/framework/omg/parser/parser_types.h +++ b/inc/framework/omg/parser/parser_types.h @@ -133,6 +133,7 @@ FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *_IF; FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *STATELESSIF; FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *IF; FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *CASE; +FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *STATELESSCASE; FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *_WHILE; FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *WHILE; FMK_FUNC_HOST_VISIBILITY FMK_FUNC_DEV_VISIBILITY extern const char *STATELESSWHILE; diff --git a/metadef b/metadef index 00261785..58412ad7 160000 --- a/metadef +++ b/metadef @@ -1 +1 @@ -Subproject commit 002617852e22767bd864db3c01595630e23f5496 +Subproject commit 58412ad7aed08cd1c01cc070d80706e4253c9075 diff --git a/third_party/fwkacllib/inc/aicpu/aicpu_schedule/aicpu_op_type_list.h b/third_party/fwkacllib/inc/aicpu/aicpu_schedule/aicpu_op_type_list.h index dbf94462..37a2e412 100644 --- a/third_party/fwkacllib/inc/aicpu/aicpu_schedule/aicpu_op_type_list.h +++ b/third_party/fwkacllib/inc/aicpu/aicpu_schedule/aicpu_op_type_list.h @@ -18,31 +18,38 @@ #define AICPU_OP_TYPE_LIST_H_ extern "C" { -enum OpKernelType { TF_KERNEL, CPU_KERNEL }; +enum OpKernelType { + TF_KERNEL, + CPU_KERNEL +}; -enum ReturnCode { OP_TYPE_NOT_SUPPORT, FORMAT_NOT_SUPPORT, DTYPE_NOT_SUPPORT }; +enum ReturnCode { + OP_TYPE_NOT_SUPPORT, + FORMAT_NOT_SUPPORT, + DTYPE_NOT_SUPPORT +}; #pragma pack(push, 1) // One byte alignment struct SysOpInfo { - uint64_t opLen; - uint64_t opType; - OpKernelType kernelsType; + uint64_t opLen; + uint64_t opType; + OpKernelType kernelsType; }; struct SysOpCheckInfo { - uint64_t opListNum; - uint64_t offSetLen; - uint64_t sysOpInfoList; - uint64_t opParamInfoList; + uint64_t opListNum; + uint64_t offSetLen; + uint64_t sysOpInfoList; + uint64_t opParamInfoList; }; struct SysOpCheckResp { - uint64_t opListNum; - bool isWithoutJson; - uint64_t returnCodeList; - uint64_t sysOpInfoList; - uint64_t opParamInfoList; + uint64_t opListNum; + bool isWithoutJson; + uint64_t returnCodeList; + uint64_t sysOpInfoList; + uint64_t opParamInfoList; }; #pragma pack(pop) } diff --git a/third_party/fwkacllib/inc/aicpu/common/aicpu_task_struct.h b/third_party/fwkacllib/inc/aicpu/common/aicpu_task_struct.h index 6dd83403..2dc0b1bb 100644 --- a/third_party/fwkacllib/inc/aicpu/common/aicpu_task_struct.h +++ b/third_party/fwkacllib/inc/aicpu/common/aicpu_task_struct.h @@ -24,81 +24,83 @@ namespace aicpu { using char_t = char; #pragma pack(push, 1) -struct AicpuParamHead { - uint32_t length; // Total length: include cunstom message - uint32_t ioAddrNum; // Input and output address number - uint32_t extInfoLength; // extInfo struct Length - uint64_t extInfoAddr; // extInfo address +struct AicpuParamHead +{ + uint32_t length; // Total length: include cunstom message + uint32_t ioAddrNum; // Input and output address number + uint32_t extInfoLength; // extInfo struct Length + uint64_t extInfoAddr; // extInfo address }; enum class AicpuConfigMsgType { - AICPU_CONFIG_MSG_TYPE_BUF_FREE = 0, /* free buf */ - AICPU_CONFIG_MSG_TYPE_BUF_RESET = 1, /* reset buf */ - AICPU_CONFIG_MSG_TYPE_BUF_SET_ADDR = 2, /* set buf addr to aicpu */ + AICPU_CONFIG_MSG_TYPE_BUF_FREE = 0, /* free buf */ + AICPU_CONFIG_MSG_TYPE_BUF_RESET = 1, /* reset buf */ + AICPU_CONFIG_MSG_TYPE_BUF_SET_ADDR = 2, /* set buf addr to aicpu */ }; enum class AicpuErrMsgType { - ERR_MSG_TYPE_NULL = 0, - ERR_MSG_TYPE_AICORE = 1, - ERR_MSG_TYPE_AICPU = 2, + ERR_MSG_TYPE_NULL = 0, + ERR_MSG_TYPE_AICORE = 1, + ERR_MSG_TYPE_AICPU = 2, }; enum class AicpuExtInfoMsgType { - EXT_MODEL_ID_MSG_TYPE = 0, + EXT_MODEL_ID_MSG_TYPE = 0, }; struct AicpuConfigMsg { - uint8_t msgType; - uint8_t reserved1; - uint16_t bufLen; - uint32_t offset; - uint64_t bufAddr; - uint32_t tsId; - uint32_t reserved2; + uint8_t msgType; + uint8_t reserved1; + uint16_t bufLen; + uint32_t offset; + uint64_t bufAddr; + uint32_t tsId; + uint32_t reserved2; }; struct AicpuModelIdInfo { - uint32_t modelId; - uint32_t extendModelId; - uint32_t extendInfo[13]; + uint32_t modelId; + uint32_t extendModelId; + uint32_t extendInfo[13]; }; // 64 bytes struct AicpuExtendInfo { - uint8_t msgType; - uint8_t version; - uint8_t reserved[2]; - union { - AicpuModelIdInfo modelIdMap; - }; + uint8_t msgType; + uint8_t version; + uint8_t reserved[2]; + union { + AicpuModelIdInfo modelIdMap; + }; }; struct AicoreErrMsgInfo { - uint8_t errType; - uint8_t version; - uint8_t reserved1[2]; /* reserved1, 4 byte alignment */ - uint32_t errorCode; - uint32_t modelId; - uint32_t taskId; - uint32_t streamId; - uint64_t transactionId; - uint8_t reserved2[228]; /* the total byte is 256, reserved2 len = 256 - other lens */ + uint8_t errType; + uint8_t version; + uint8_t reserved1[2]; /* reserved1, 4 byte alignment */ + uint32_t errorCode; + uint32_t modelId; + uint32_t taskId; + uint32_t streamId; + uint64_t transactionId; + uint8_t reserved2[228]; /* the total byte is 256, reserved2 len = 256 - other lens */ }; struct AicpuErrMsgInfo { - uint8_t errType; - uint8_t version; - uint8_t reserved1[2]; /* reserved1, 4 byte alignment */ - uint32_t errorCode; - uint32_t modelId; - uint32_t streamId; - uint64_t transactionId; - char_t opName[64]; /* op name str */ - char_t errDesc[128]; /* err msg desc info */ - uint8_t reserved2[40]; /* the total byte is 256, reserved2 len = 256 - other lens */ + uint8_t errType; + uint8_t version; + uint8_t reserved1[2]; /* reserved1, 4 byte alignment */ + uint32_t errorCode; + uint32_t modelId; + uint32_t streamId; + uint64_t transactionId; + char_t opName[64]; /* op name str */ + char_t errDesc[128]; /* err msg desc info */ + uint8_t reserved2[40]; /* the total byte is 256, reserved2 len = 256 - other lens */ }; #pragma pack(pop) } // namespace aicpu #endif // AICPU_TASK_STRUCT_H + diff --git a/third_party/fwkacllib/inc/common/type_def.h b/third_party/fwkacllib/inc/common/type_def.h index 043b550d..1bbaf32d 100644 --- a/third_party/fwkacllib/inc/common/type_def.h +++ b/third_party/fwkacllib/inc/common/type_def.h @@ -1,13 +1,13 @@ /** - * Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - * - * Description:interface. - * Create: 2021-12-21 - */ +* Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* +* Description:interface. +* Create: 2021-12-21 +*/ #ifndef AICPU_TYPE_DEF_H #define AICPU_TYPE_DEF_H @@ -25,24 +25,28 @@ typedef float float32_t; typedef double float64_t; #endif -inline uint64_t PtrToValue(const void *ptr) { - return static_cast(reinterpret_cast(ptr)); +inline uint64_t PtrToValue(const void *ptr) +{ + return static_cast(reinterpret_cast(ptr)); } -inline void *ValueToPtr(const uint64_t value) { - return reinterpret_cast(static_cast(value)); +inline void *ValueToPtr(const uint64_t value) +{ + return reinterpret_cast(static_cast(value)); } -template -inline TO *PtrToPtr(TI *ptr) { - return reinterpret_cast(ptr); +template +inline TO *PtrToPtr(TI *ptr) +{ + return reinterpret_cast(ptr); } -template -inline T *PtrAdd(T *const ptr, const size_t maxIdx, const size_t idx) { - if ((ptr != nullptr) && (idx < maxIdx)) { - return reinterpret_cast(ptr + idx); - } - return nullptr; +template +inline T *PtrAdd(T * const ptr, const size_t maxIdx, const size_t idx) +{ + if ((ptr != nullptr) && (idx < maxIdx)) { + return reinterpret_cast(ptr + idx); + } + return nullptr; } #endif // AICPU_TYPE_DEF_H diff --git a/third_party/fwkacllib/inc/ops/rnn.h b/third_party/fwkacllib/inc/ops/rnn.h index 51784547..2ab5843f 100644 --- a/third_party/fwkacllib/inc/ops/rnn.h +++ b/third_party/fwkacllib/inc/ops/rnn.h @@ -25,31 +25,31 @@ namespace ge { /** -*@brief: Basic LSTM Cell forward calculation. -*@par Inputs: -*five inputs: -*@li x:A 4D Tensor. Must be one of the following types: float16. -*@li h:A 4D Tensor. Must be one of the following types: float16. -*@li c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li w:A 4D Tensor. Must be one of the following types: float16. -*@li b:A 1D Tensor. Must be one of the following types: float16. The format must be ND . \n -*@li mask:A 1D Tensor. Must be one of the following types: uint8. - -*@par Attributes: -*@li keep_prob:An integer identifying the keep prob in the op. Default to 1. -*@li forget_bias:An integer identifying the forget bias in the op. Default to 1. -*@li state_is_tuple:An bool identifying if the hidden state and cell state is tuple. Default to true. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported . \n +* @brief: Basic LSTM Cell forward calculation. +* @par Inputs: +* five inputs: +* @li x:A 4D Tensor. Must be one of the following types: float16. +* @li h:A 4D Tensor. Must be one of the following types: float16. +* @li c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li w:A 4D Tensor. Must be one of the following types: float16. +* @li b:A 1D Tensor. Must be one of the following types: float16. The format must be ND . \n +* @li mask:A 1D Tensor. Must be one of the following types: uint8. -*@par Outputs: -*seven outputs: -*@li ct:A 4D Tensor. Must be one of the following types: float16, float32. -*@li ht:A 4D Tensor. Must be one of the following types: float16. -*@li it:A 4D Tensor. Must be one of the following types: float16, float32. -*@li jt:A 4D Tensor. Must be one of the following types: float16, float32. -*@li ft:A 4D Tensor. Must be one of the following types: float16, float32. -*@li ot:A 4D Tensor. Must be one of the following types: float16, float32. -*@li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Attributes: +* @li keep_prob:An integer identifying the keep prob in the op. Default to 1. +* @li forget_bias:An integer identifying the forget bias in the op. Default to 1. +* @li state_is_tuple:An bool identifying if the hidden state and cell state is tuple. Default to true. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported . \n + +* @par Outputs: +* seven outputs: +* @li ct:A 4D Tensor. Must be one of the following types: float16, float32. +* @li ht:A 4D Tensor. Must be one of the following types: float16. +* @li it:A 4D Tensor. Must be one of the following types: float16, float32. +* @li jt:A 4D Tensor. Must be one of the following types: float16, float32. +* @li ft:A 4D Tensor. Must be one of the following types: float16, float32. +* @li ot:A 4D Tensor. Must be one of the following types: float16, float32. +* @li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. */ REG_OP(BasicLSTMCell) .INPUT(x, TensorType({DT_FLOAT16})) @@ -72,18 +72,18 @@ REG_OP(BasicLSTMCell) .OP_END_FACTORY_REG(BasicLSTMCell) /** -*@brief: Dynamic LSTM forward calculation . \n +* @brief: Dynamic LSTM forward calculation . \n -*@par Inputs: -*@li x:A 4D Tensor. Must be the type float32. -*@li w:A 4D Tensor. Must be the type float32. -*@li b:A 1D Tensor. Must be the type float32. The format must be ND . \n +* @par Inputs: +* @li x:A 4D Tensor. Must be the type float32. +* @li w:A 4D Tensor. Must be the type float32. +* @li b:A 1D Tensor. Must be the type float32. The format must be ND . \n -*@par Outputs: -*output_h:A Tensor of output. Must be the type float32. +* @par Outputs: +* output_h:A Tensor of output. Must be the type float32. -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(DynamicLSTM) .INPUT(x, TensorType({DT_FLOAT32})) @@ -93,52 +93,53 @@ REG_OP(DynamicLSTM) .OP_END_FACTORY_REG(DynamicLSTM) /** -*@brief: DynamicRNNGrad calculation. -*@par Inputs: -*ten inputs: \n -*@li x:A 4D Tensor. Must be one of the following types: float16, float32. -*@li w:A 4D Tensor. Must be one of the following types: float16, float32. -*@li b:A 1D Tensor. Must be one of the following types: float16, float32. -*@li y:A 1D Tensor. Must be one of the following types: int32. -*@li init_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li init_c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dy:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dc:A 4D Tensor. Must be one of the following types: float16, float32. -*@li i:A 4D Tensor. Must be one of the following types: float16, float32. -*@li j:A 4D Tensor. Must be one of the following types: float16, float32. -*@li f:A 4D Tensor. Must be one of the following types: float16, float32. -*@li o:A 4D Tensor. Must be one of the following types: float16, float32. -*@li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. -*@li seq_length:A 1D Tensor. Must be one of the following types: int32. -*@li mask:A 1D Tensor. Must be one of the following types: int8. -*@li wci:A 4D Tensor. Must be one of the following types: float16, float32. -*@li wcf:A 4D Tensor. Must be one of the following types: float16, float32. -*@li wco:A 4D Tensor. Must be one of the following types: float16, float32. - -*@par Attributes: -*@li cell_type:An string identifying the cell type in the op. Default to "LSTM". Only LSTM is currently supported. -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li use_peephole:An bool identifying if use peephole in the op. Default to false. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to false. -*@li forget_bias:An float identifying the forget bias in the op. Default to 0. +* @brief: DynamicRNNGrad calculation. +* @par Inputs: +* ten inputs: \n +* @li x:A 4D Tensor. Must be one of the following types: float16, float32. +* @li w:A 4D Tensor. Must be one of the following types: float16, float32. +* @li b:A 1D Tensor. Must be one of the following types: float16, float32. +* @li y:A 1D Tensor. Must be one of the following types: int32. +* @li init_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li init_c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dy:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dc:A 4D Tensor. Must be one of the following types: float16, float32. +* @li i:A 4D Tensor. Must be one of the following types: float16, float32. +* @li j:A 4D Tensor. Must be one of the following types: float16, float32. +* @li f:A 4D Tensor. Must be one of the following types: float16, float32. +* @li o:A 4D Tensor. Must be one of the following types: float16, float32. +* @li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. +* @li seq_length:A 1D Tensor. Must be one of the following types: int32. +* @li mask:A 1D Tensor. Must be one of the following types: int8. +* @li wci:A 4D Tensor. Must be one of the following types: float16, float32. +* @li wcf:A 4D Tensor. Must be one of the following types: float16, float32. +* @li wco:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Outputs: -*eight outputs: \n -*@li dw:A 4D Tensor. Must be one of the following types: float16, float32. -*@li db:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dx:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dc_prev:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dwci:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dwcf:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dwco:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Attributes: +* @li cell_type:An string identifying the cell type in the op. Default to "LSTM". Only LSTM is currently supported. +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li use_peephole:An bool identifying if use peephole in the op. Default to false. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to false. +* @li forget_bias:An float identifying the forget bias in the op. Default to 0. +* @li gate_order:An string identifying the type of gate order in the op. Support "ijfo" and "ifjo". Default to "ijfo". + +* @par Outputs: +* eight outputs: \n +* @li dw:A 4D Tensor. Must be one of the following types: float16, float32. +* @li db:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dx:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dc_prev:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dwci:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dwcf:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dwco:A 4D Tensor. Must be one of the following types: float16, float32. */ REG_OP(DynamicRNNGrad) .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT})) @@ -179,48 +180,49 @@ REG_OP(DynamicRNNGrad) .ATTR(num_proj, Int, 0) .ATTR(time_major, Bool, true) .ATTR(forget_bias, Float, 0.0) + .ATTR(gate_order, String, "ijfo") .OP_END_FACTORY_REG(DynamicRNNGrad) /** -*@brief: DynamicRNN calculation. -*@par Inputs: -*ten inputs: -*@li x:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li w:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li b:A required 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li seq_length:A optional Tensor. Only Support int32 in ND. -*@li init_h:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li init_c:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li wci:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li wcf:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li wco:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li mask:A 1D optional Tensor. Must be one of the following types: uint8. The format must be ND . \n - -*@par Attributes: -*@li cell_type:An string identifying the cell type in the op. Default to "LSTM". Only LSTM is currently supported. -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li use_peephole:An bool identifying if use peephole in the op. Default to false. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. -*@li forget_bias:An float identifying the forget bias in the op. Default to 0. -*@li gate_order:An string identifying the type of gate order in the op. Support "ijfo" and "ifjo". Default to "ijfo". -*@li is_training:An bool identifying is training in the op. Default to true . \n +* @brief: DynamicRNN calculation. +* @par Inputs: +* ten inputs: +* @li x:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li w:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li b:A required 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li seq_length:A optional Tensor. Only Support int32 in ND. +* @li init_h:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li init_c:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li wci:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li wcf:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li wco:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li mask:A 1D optional Tensor. Must be one of the following types: uint8. The format must be ND . \n -*@par Outputs: -*eight outputs: -*@li y:A 4D Tensor. Must be one of the following types: float16, float32. -*@li output_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li output_c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li i:A 4D Tensor. Must be one of the following types: float16, float32. -*@li j:A 4D Tensor. Must be one of the following types: float16, float32. -*@li f:A 4D Tensor. Must be one of the following types: float16, float32. -*@li o:A 4D Tensor. Must be one of the following types: float16, float32. -*@li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Third-party framework compatibility: +* @par Attributes: +* @li cell_type:An string identifying the cell type in the op. Default to "LSTM". Only LSTM is currently supported. +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li use_peephole:An bool identifying if use peephole in the op. Default to false. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. +* @li forget_bias:An float identifying the forget bias in the op. Default to 0. +* @li gate_order:An string identifying the type of gate order in the op. Support "ijfo" and "ifjo". Default to "ijfo". +* @li is_training:An bool identifying is training in the op. Default to true . \n + +* @par Outputs: +* eight outputs: +* @li y:A 4D Tensor. Must be one of the following types: float16, float32. +* @li output_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li output_c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li i:A 4D Tensor. Must be one of the following types: float16, float32. +* @li j:A 4D Tensor. Must be one of the following types: float16, float32. +* @li f:A 4D Tensor. Must be one of the following types: float16, float32. +* @li o:A 4D Tensor. Must be one of the following types: float16, float32. +* @li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Third-party framework compatibility: * Compatible with the TF operator LSTM. */ REG_OP(DynamicRNN) @@ -257,56 +259,56 @@ REG_OP(DynamicRNN) .OP_END_FACTORY_REG(DynamicRNN) /** -*@brief: DynamicRNNV2 calculation. -*@par Inputs: -*ten inputs: -*@li x:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li weight_input:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li weight_hidden:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li b:A required 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li seq_length:A optional 1D Tensor. Must be one of the following types: float16, int32. -*@li init_h:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li init_c:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li wci:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li wcf:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li wco:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li mask:A 1D optional Tensor. Must be one of the following types: uint8. The format must be ND . \n - -*@par Attributes: -*@li cell_type:An string identifying the cell type in the op. Default to "LSTM". Only LSTM is currently supported. -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". -*Only UNIDIRECTIONAL is currently supported. -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li use_peephole:An bool identifying if use peephole in the op. Default to false. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". -*Support "tanh" and "clip". -*@li recurrent_activation:An string identifying the type of activation function in the op. Default to "sigmoid". -*Support "sigmoid" and "hard_sigmoid". In general, set "hard_sigmoid" for TF Keras LSTM. -*@li forget_bias:An float identifying the forget bias in the op. Default to 0. -*@li gate_order:An string identifying the type of gate order in the op. Support "ijfo" and "ifco". Default to "ijfo". -*Set "ijfo" for TF operator LSTM, Set "ifco" for TF Keras LSTM. -*@li stateful: An bool identifying the type of stateful in the op. Default to fasle.Only false is currently supported. -*@li merge_mode: An string identifying the type of merge_modein the op. Default to "concat". -*Only "concat" is currently supported -*@li is_training:An bool identifying is training in the op. Default to true . \n +* @brief: DynamicRNNV2 calculation. +* @par Inputs: +* ten inputs: +* @li x:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li weight_input:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li weight_hidden:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li b:A required 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li seq_length:A optional 1D Tensor. Must be one of the following types: float16, int32. +* @li init_h:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li init_c:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li wci:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li wcf:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li wco:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li mask:A 1D optional Tensor. Must be one of the following types: uint8. The format must be ND . \n -*@par Outputs: -*eight outputs: -*@li y:A 4D Tensor. Must be one of the following types: float16, float32. -*@li output_h:A 4D Tensor. Must be one of the following types: float16, float32. -*Return the last output_h. -*@li output_c:A 4D Tensor. Must be one of the following types: float16, float32. -*Return the last output_c. -*@li i:A 4D Tensor. Must be one of the following types: float16, float32. -*@li j:A 4D Tensor. Must be one of the following types: float16, float32. -*@li f:A 4D Tensor. Must be one of the following types: float16, float32. -*@li o:A 4D Tensor. Must be one of the following types: float16, float32. -*@li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Third-party framework compatibility: +* @par Attributes: +* @li cell_type:An string identifying the cell type in the op. Default to "LSTM". Only LSTM is currently supported. +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". +* Only UNIDIRECTIONAL is currently supported. +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li use_peephole:An bool identifying if use peephole in the op. Default to false. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". +* Support "tanh" and "clip". +* @li recurrent_activation:An string identifying the type of activation function in the op. Default to "sigmoid". +* Support "sigmoid" and "hard_sigmoid". In general, set "hard_sigmoid" for TF Keras LSTM. +* @li forget_bias:An float identifying the forget bias in the op. Default to 0. +* @li gate_order:An string identifying the type of gate order in the op. Support "ijfo" and "ifco". Default to "ijfo". +* Set "ijfo" for TF operator LSTM, Set "ifco" for TF Keras LSTM. +* @li stateful: An bool identifying the type of stateful in the op. Default to fasle.Only false is currently supported. +* @li merge_mode: An string identifying the type of merge_modein the op. Default to "concat". +* Only "concat" is currently supported +* @li is_training:An bool identifying is training in the op. Default to true . \n + +* @par Outputs: +* eight outputs: +* @li y:A 4D Tensor. Must be one of the following types: float16, float32. +* @li output_h:A 4D Tensor. Must be one of the following types: float16, float32. +* Return the last output_h. +* @li output_c:A 4D Tensor. Must be one of the following types: float16, float32. +* Return the last output_c. +* @li i:A 4D Tensor. Must be one of the following types: float16, float32. +* @li j:A 4D Tensor. Must be one of the following types: float16, float32. +* @li f:A 4D Tensor. Must be one of the following types: float16, float32. +* @li o:A 4D Tensor. Must be one of the following types: float16, float32. +* @li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Third-party framework compatibility: * Compatible with the TF operator LSTM or TF keras operator LSTM. */ @@ -459,46 +461,46 @@ REG_OP(DynamicRNNV2Grad) .OP_END_FACTORY_REG(DynamicRNNV2Grad) /** -*@brief: DynamicRNNV3 calculation. -*@par Inputs: -*ten inputs: -*@li x:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li w:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li b:A required 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li seq_length:A optional 1D Tensor. Must be one of the following types: int32. The format must be ND. -*@li init_h:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li init_c:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li wci:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li wcf:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li wco:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li mask:A 1D optional Tensor. Must be one of the following types: uint8. The format must be ND . \n -*@li real_mask:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@li project:A 4D optional Tensor. Must be one of the following types: float16, float32. - -*@par Attributes: -*@li cell_type:An string identifying the cell type in the op. Default to "LSTM". Only LSTM is currently supported. -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li use_peephole:An bool identifying if use peephole in the op. Default to false. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. -*@li forget_bias:An float identifying the forget bias in the op. Default to 0. -*@li is_training:An bool identifying is training in the op. Default to true . \n +* @brief: DynamicRNNV3 calculation. +* @par Inputs: +* ten inputs: +* @li x:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li w:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li b:A required 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li seq_length:A optional 1D Tensor. Must be one of the following types: int32. The format must be ND. +* @li init_h:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li init_c:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li wci:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li wcf:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li wco:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li mask:A 1D optional Tensor. Must be one of the following types: uint8. The format must be ND . \n +* @li real_mask:A 4D optional Tensor. Must be one of the following types: float16, float32. +* @li project:A 4D optional Tensor. Must be one of the following types: float16, float32. -*@par Outputs: -*eight outputs: -*@li y:A 4D Tensor. Must be one of the following types: float16, float32. -*@li output_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li output_c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li i:A 4D Tensor. Must be one of the following types: float16, float32. -*@li j:A 4D Tensor. Must be one of the following types: float16, float32. -*@li f:A 4D Tensor. Must be one of the following types: float16, float32. -*@li o:A 4D Tensor. Must be one of the following types: float16, float32. -*@li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Third-party framework compatibility: +* @par Attributes: +* @li cell_type:An string identifying the cell type in the op. Default to "LSTM". Only LSTM is currently supported. +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li use_peephole:An bool identifying if use peephole in the op. Default to false. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. +* @li forget_bias:An float identifying the forget bias in the op. Default to 0. +* @li is_training:An bool identifying is training in the op. Default to true . \n + +* @par Outputs: +* eight outputs: +* @li y:A 4D Tensor. Must be one of the following types: float16, float32. +* @li output_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li output_c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li i:A 4D Tensor. Must be one of the following types: float16, float32. +* @li j:A 4D Tensor. Must be one of the following types: float16, float32. +* @li f:A 4D Tensor. Must be one of the following types: float16, float32. +* @li o:A 4D Tensor. Must be one of the following types: float16, float32. +* @li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Third-party framework compatibility: * Compatible with the TF operator LSTM. */ REG_OP(DynamicRNNV3) @@ -536,37 +538,37 @@ REG_OP(DynamicRNNV3) .OP_END_FACTORY_REG(DynamicRNNV3) /** -*@brief: DynamicLSTMV2 calculation. -*@par Inputs: -*ten inputs: -*@li x:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li w:A required 4D Tensor. Must be one of the following types: float16, float32. -*@li b:A required 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li cont:A required 2D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li w_xc_x_static:A optional 2D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li h0:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li c0:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li wci:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li wcf:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li wco:A optional 4D Tensor. Must be one of the following types: float16, float32. -*@li mask:A optional 1D Tensor. Must be one of the following types: uint8. The format must be ND . - -*@par Attributes: -*@li num_output:An integer identifying the num projection in the op. Default to 0. -*@li expose_hidden:An bool identifying the expose_hidden in the op. Default to flase. -*@li need_output_last:An bool identifying the time major in the op. Default to true. -*@li forget_bias:An float identifying the forget bias in the op. Default to 0. +* @brief: DynamicLSTMV2 calculation. +* @par Inputs: +* ten inputs: +* @li x:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li w:A required 4D Tensor. Must be one of the following types: float16, float32. +* @li b:A required 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li cont:A required 2D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li w_xc_x_static:A optional 2D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li h0:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li c0:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li wci:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li wcf:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li wco:A optional 4D Tensor. Must be one of the following types: float16, float32. +* @li mask:A optional 1D Tensor. Must be one of the following types: uint8. The format must be ND . -*@par Outputs: -*eight outputs: -*@li y:A 4D Tensor. Must be one of the following types: float16, float32. -*@li output_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li output_c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li last_output_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li last_output_c:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Third-party framework compatibility: +* @par Attributes: +* @li num_output:An integer identifying the num projection in the op. Default to 0. +* @li expose_hidden:An bool identifying the expose_hidden in the op. Default to flase. +* @li need_output_last:An bool identifying the time major in the op. Default to true. +* @li forget_bias:An float identifying the forget bias in the op. Default to 0. + +* @par Outputs: +* eight outputs: +* @li y:A 4D Tensor. Must be one of the following types: float16, float32. +* @li output_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li output_c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li last_output_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li last_output_c:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Third-party framework compatibility: * Compatible with the Caffe operator LSTM. -*@par Restrictions: +* @par Restrictions: * Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(DynamicLSTMV2) @@ -593,28 +595,28 @@ REG_OP(DynamicLSTMV2) .OP_END_FACTORY_REG(DynamicLSTMV2) /** -*@brief: LSTMInputGrad calculation. -*@par Inputs: -*ten inputs: \n -*@li w:A 4D Tensor. Must be one of the following types: float16, float32. -*@li init_c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dy:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dc:A 4D Tensor. Must be one of the following types: float16, float32. -*@li i:A 4D Tensor. Must be one of the following types: float16, float32. -*@li j:A 4D Tensor. Must be one of the following types: float16, float32. -*@li f:A 4D Tensor. Must be one of the following types: float16, float32. -*@li o:A 4D Tensor. Must be one of the following types: float16, float32. -*@li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. +* @brief: LSTMInputGrad calculation. +* @par Inputs: +* ten inputs: \n +* @li w:A 4D Tensor. Must be one of the following types: float16, float32. +* @li init_c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dy:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dc:A 4D Tensor. Must be one of the following types: float16, float32. +* @li i:A 4D Tensor. Must be one of the following types: float16, float32. +* @li j:A 4D Tensor. Must be one of the following types: float16, float32. +* @li f:A 4D Tensor. Must be one of the following types: float16, float32. +* @li o:A 4D Tensor. Must be one of the following types: float16, float32. +* @li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Outputs: -*four outputs: \n -*@li dx:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dc_prev:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dgate:A 4D Tensor. Must be one of the following types: float16. +* @par Outputs: +* four outputs: \n +* @li dx:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dc_prev:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dgate:A 4D Tensor. Must be one of the following types: float16. */ REG_OP(LSTMInputGrad) .INPUT(w, TensorType({DT_FLOAT16, DT_FLOAT})) @@ -637,35 +639,35 @@ REG_OP(LSTMInputGrad) /** -*@brief: Dynamic LSTM Cell grad calculation.Calculate the gradient of gates and cell state. -*@par Inputs: -*twelve inputs: -*@li init_c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dy:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dc:A 4D Tensor. Must be one of the following types: float16, float32. -*@li i:A 4D Tensor. Must be one of the following types: float16, float32. -*@li j:A 4D Tensor. Must be one of the following types: float16, float32. -*@li f:A 4D Tensor. Must be one of the following types: float16, float32. -*@li o:A 4D Tensor. Must be one of the following types: float16, float32. -*@li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. -*@li mask:A 4D Tensor. Must be one of the following types: float16, float32. -*@li t_state:A 4D Tensor. Must be one of the following types: float16, float32. . \n - -*@par Attributes: -*@li forget_bias:An integer identifying the forget bias in the op. Default to 1. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported . \n -*@li direction:An string that marks the calculation sequence of the operator. Default to "Forward". -*@li gate_order:An string mark the order of output 4 gate. Default to "ijfo". +* @brief: Dynamic LSTM Cell grad calculation.Calculate the gradient of gates and cell state. +* @par Inputs: +* twelve inputs: +* @li init_c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dy:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dc:A 4D Tensor. Must be one of the following types: float16, float32. +* @li i:A 4D Tensor. Must be one of the following types: float16, float32. +* @li j:A 4D Tensor. Must be one of the following types: float16, float32. +* @li f:A 4D Tensor. Must be one of the following types: float16, float32. +* @li o:A 4D Tensor. Must be one of the following types: float16, float32. +* @li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. +* @li mask:A 4D Tensor. Must be one of the following types: float16, float32. +* @li t_state:A 4D Tensor. Must be one of the following types: float16, float32. . \n -*@par Outputs: -*two outputs: -*@li dgate:A 4D Tensor. Must be one of the following types: float16. -*@li dct_1:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Attributes: +* @li forget_bias:An integer identifying the forget bias in the op. Default to 1. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported . \n +* @li direction:An string that marks the calculation sequence of the operator. Default to "Forward". +* @li gate_order:An string mark the order of output 4 gate. Default to "ijfo". -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Outputs: +* two outputs: +* @li dgate:A 4D Tensor. Must be one of the following types: float16. +* @li dct_1:A 4D Tensor. Must be one of the following types: float16, float32. + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(DynamicLSTMGradCell) .INPUT(init_c, TensorType({DT_FLOAT16, DT_FLOAT})) @@ -690,23 +692,23 @@ REG_OP(DynamicLSTMGradCell) /** -*@brief: Basic LSTM Cell backward calculation.Calculate the gradient of input and hidden state. -*@par Inputs: -*three inputs: -*@li dgate:A 4D Tensor. Must be one of the following types: float16. -*@li w:A 4D Tensor. Must be one of the following types: float16. -*@li dropout_mask:A 1D Tensor. Must be one of the following types: uint8. The format must be ND . \n +* @brief: Basic LSTM Cell backward calculation.Calculate the gradient of input and hidden state. +* @par Inputs: +* three inputs: +* @li dgate:A 4D Tensor. Must be one of the following types: float16. +* @li w:A 4D Tensor. Must be one of the following types: float16. +* @li dropout_mask:A 1D Tensor. Must be one of the following types: uint8. The format must be ND . \n -*@par Attributes: -*keep_prob:An integer identifying the keep prob in the op. Default to 1 . \n +* @par Attributes: +* keep_prob:An integer identifying the keep prob in the op. Default to 1 . \n -*@par Outputs: -*two outputs: -*@li dxt:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dht:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Outputs: +* two outputs: +* @li dxt:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dht:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(BasicLSTMCellInputGrad) .INPUT(dgate, TensorType({DT_FLOAT16})) @@ -718,20 +720,20 @@ REG_OP(BasicLSTMCellInputGrad) .OP_END_FACTORY_REG(BasicLSTMCellInputGrad) /** -*@brief: Basic LSTM Cell backward calculation.Calculate the gradient of weight and bias. -*@par Inputs: -*three inputs: -*@li x:A 4D Tensor. Must be one of the following types: float16. -*@li h:A 4D Tensor. Must be one of the following types: float16. -*@li dgate:A 4D Tensor. Must be one of the following types: uint8. \n +* @brief: Basic LSTM Cell backward calculation.Calculate the gradient of weight and bias. +* @par Inputs: +* three inputs: +* @li x:A 4D Tensor. Must be one of the following types: float16. +* @li h:A 4D Tensor. Must be one of the following types: float16. +* @li dgate:A 4D Tensor. Must be one of the following types: uint8. \n -*@par Outputs: -*two outputs: -*@li dw:A 4D Tensor. Must be one of the following types: float16. -*@li db:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Outputs: +* two outputs: +* @li dw:A 4D Tensor. Must be one of the following types: float16. +* @li db:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(BasicLSTMCellWeightGrad) .INPUT(x, TensorType({DT_FLOAT16})) @@ -742,29 +744,29 @@ REG_OP(BasicLSTMCellWeightGrad) .OP_END_FACTORY_REG(BasicLSTMCellWeightGrad) /** -*@brief: Basic LSTM Cell backward calculation.Calculate the gradient of gates and cell state. -*@par Inputs: -*eight inputs: -*@li c:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dht:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dct:A 4D Tensor. Must be one of the following types: float16, float32. -*@li it:A 4D Tensor. Must be one of the following types: float16, float32. -*@li jt:A 4D Tensor. Must be one of the following types: float16, float32. -*@li ft:A 4D Tensor. Must be one of the following types: float16, float32. -*@li ot:A 4D Tensor. Must be one of the following types: float16, float32. -*@li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. \n - -*@par Attributes: -*@li forget_bias:An integer identifying the forget bias in the op. Default to 1. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported . \n +* @brief: Basic LSTM Cell backward calculation.Calculate the gradient of gates and cell state. +* @par Inputs: +* eight inputs: +* @li c:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dht:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dct:A 4D Tensor. Must be one of the following types: float16, float32. +* @li it:A 4D Tensor. Must be one of the following types: float16, float32. +* @li jt:A 4D Tensor. Must be one of the following types: float16, float32. +* @li ft:A 4D Tensor. Must be one of the following types: float16, float32. +* @li ot:A 4D Tensor. Must be one of the following types: float16, float32. +* @li tanhct:A 4D Tensor. Must be one of the following types: float16, float32. \n -*@par Outputs: -*two outputs: -*@li dgate:A 4D Tensor. Must be one of the following types: float16. -*@li dct_1:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Attributes: +* @li forget_bias:An integer identifying the forget bias in the op. Default to 1. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported . \n + +* @par Outputs: +* two outputs: +* @li dgate:A 4D Tensor. Must be one of the following types: float16. +* @li dct_1:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(BasicLSTMCellCStateGrad) .INPUT(c, TensorType({DT_FLOAT16, DT_FLOAT})) @@ -782,30 +784,30 @@ REG_OP(BasicLSTMCellCStateGrad) .OP_END_FACTORY_REG(BasicLSTMCellCStateGrad) /** -*@brief: RNN operator. -*@par Inputs: -*eight inputs: -*@li x:A 4D Tensor. Must be one of the following types: float16. -*@li cont:A 1D Tensor. Must be one of the following types: float16. The format must be ND. -*@li x_static:A 4D Tensor. Must be one of the following types: float16. -*@li h_0:A 4D Tensor. Must be one of the following types: float16, float32. -*@li w_xh:A 4D Tensor. Must be one of the following types: float16. -*@li w_sh:A 4D Tensor. Must be one of the following types: float16. -*@li w_hh:A 4D Tensor. Must be one of the following types: float16. -*@li w_ho:A 4D Tensor. Must be one of the following types: float16. -*@li bias_h:A 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li bias_o:A 1D Tensor. Must be one of the following types: float16, float32. The format must be ND . \n - -*@par Attributes: -*@li expose_hidden:An bool identifying if expose the hidden state of last time step. Default to false. -*@li num_output:An integer identifying the number of output features. Default to 0 . \n +* @brief: RNN operator. +* @par Inputs: +* eight inputs: +* @li x:A 4D Tensor. Must be one of the following types: float16. +* @li cont:A 1D Tensor. Must be one of the following types: float16. The format must be ND. +* @li x_static:A 4D Tensor. Must be one of the following types: float16. +* @li h_0:A 4D Tensor. Must be one of the following types: float16, float32. +* @li w_xh:A 4D Tensor. Must be one of the following types: float16. +* @li w_sh:A 4D Tensor. Must be one of the following types: float16. +* @li w_hh:A 4D Tensor. Must be one of the following types: float16. +* @li w_ho:A 4D Tensor. Must be one of the following types: float16. +* @li bias_h:A 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li bias_o:A 1D Tensor. Must be one of the following types: float16, float32. The format must be ND . \n -*@par Outputs: -*two outputs: -*@li o:A 4D Tensor. Must be one of the following types: float16, float32. -*@li h_t:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Attributes: +* @li expose_hidden:An bool identifying if expose the hidden state of last time step. Default to false. +* @li num_output:An integer identifying the number of output features. Default to 0 . \n + +* @par Outputs: +* two outputs: +* @li o:A 4D Tensor. Must be one of the following types: float16, float32. +* @li h_t:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(RNN) .INPUT(x, TensorType({DT_FLOAT16})) @@ -825,30 +827,30 @@ REG_OP(RNN) .OP_END_FACTORY_REG(RNN) /** -*@brief: BasicRNNCell operator. -*@par Inputs: -*eight inputs: -*@li x:A 4D Tensor. Must be one of the following types: float16. -*@li cont:A 1D Tensor. Must be one of the following types: float16. The format must be ND. -*@li w_xh_x_static:A 4D Tensor. Must be one of the following types: float16. -*@li h_0:A 4D Tensor. Must be one of the following types: float16, float32. -*@li w_xh:A 4D Tensor. Must be one of the following types: float16. -*@li w_hh:A 4D Tensor. Must be one of the following types: float16. -*@li w_ho:A 4D Tensor. Must be one of the following types: float16. -*@li bias_h:A 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li bias_o:A 1D Tensor. Must be one of the following types: float16, float32. The format must be ND . \n - -*@par Attributes: -*@li expose_hidden:An bool identifying if expose the hidden state of last time step. Default to false. -*@li num_output:An integer identifying the number of output features. Default to 0 . \n +* @brief: BasicRNNCell operator. +* @par Inputs: +* eight inputs: +* @li x:A 4D Tensor. Must be one of the following types: float16. +* @li cont:A 1D Tensor. Must be one of the following types: float16. The format must be ND. +* @li w_xh_x_static:A 4D Tensor. Must be one of the following types: float16. +* @li h_0:A 4D Tensor. Must be one of the following types: float16, float32. +* @li w_xh:A 4D Tensor. Must be one of the following types: float16. +* @li w_hh:A 4D Tensor. Must be one of the following types: float16. +* @li w_ho:A 4D Tensor. Must be one of the following types: float16. +* @li bias_h:A 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li bias_o:A 1D Tensor. Must be one of the following types: float16, float32. The format must be ND . \n -*@par Outputs: -*two outputs: -*@li o_t:A 4D Tensor. Must be one of the following types: float16, float32. -*@li h_t:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Attributes: +* @li expose_hidden:An bool identifying if expose the hidden state of last time step. Default to false. +* @li num_output:An integer identifying the number of output features. Default to 0 . \n -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Outputs: +* two outputs: +* @li o_t:A 4D Tensor. Must be one of the following types: float16, float32. +* @li h_t:A 4D Tensor. Must be one of the following types: float16, float32. + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(BasicRNNCell) .INPUT(x, TensorType({DT_FLOAT16})) @@ -867,37 +869,37 @@ REG_OP(BasicRNNCell) .OP_END_FACTORY_REG(BasicRNNCell) /** -*@brief DynamicGRU calculation. -*@par Inputs: -*seven inputs: -*@li x:Must be one of the following types: float16. -*@li w:Must be one of the following types: float16. -*@li b:Must be one of the following types: float16, float32. The format must be ND. -*@li cw:Must be one of the following types: float16. -*@li cb:Must be one of the following types: float16, float32. The format must be ND. -*@li seq_length:Must be one of the following types: int32. The format must be ND. -*@li init_h:Must be one of the following types: float16, float32. - -*@par Attributes: -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. -*@li is_training:An bool identifying is training in the op. Default to true. +* @brief DynamicGRU calculation. +* @par Inputs: +* seven inputs: +* @li x:Must be one of the following types: float16. +* @li w:Must be one of the following types: float16. +* @li b:Must be one of the following types: float16, float32. The format must be ND. +* @li cw:Must be one of the following types: float16. +* @li cb:Must be one of the following types: float16, float32. The format must be ND. +* @li seq_length:Must be one of the following types: int32. The format must be ND. +* @li init_h:Must be one of the following types: float16, float32. -*@par Outputs: -*five outputs: -*@li y:Must be one of the following types: float16, float32. -*@li output_h:Must be one of the following types: float16, float32. -*@li r:Must be one of the following types: float16, float32. -*@li i:Must be one of the following types: float16, float32. -*@li n:Must be one of the following types: float16, float32. - -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Attributes: +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. +* @li is_training:An bool identifying is training in the op. Default to true. + +* @par Outputs: +* five outputs: +* @li y:Must be one of the following types: float16, float32. +* @li output_h:Must be one of the following types: float16, float32. +* @li r:Must be one of the following types: float16, float32. +* @li i:Must be one of the following types: float16, float32. +* @li n:Must be one of the following types: float16, float32. + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(DynamicGRU) .INPUT(x, TensorType({DT_FLOAT16})) @@ -923,37 +925,37 @@ REG_OP(DynamicGRU) .OP_END_FACTORY_REG(DynamicGRU) /** -*@brief DynamicGRUV2 calculation. -*@par Inputs: -*seven inputs: -*@li x:Must be one of the following types: float16. -*@li weight_input:Must be one of the following types: float16. -*@li weight_hidden:Must be one of the following types: float16. -*@li bias_input:Must be one of the following types: float16, float32. The format must be ND. -*@li bias_hidden:Must be one of the following types: float16, float32. The format must be ND. -*@li seq_length:Must be one of the following types: int32 in ND. -*@li init_h:Must be one of the following types: float16, float32. - -*@par Attributes: -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Support "UNIDIRECTIONAL" and "REDIRECTIONAL". -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. -*@li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. -*@li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. -*@li is_training:An bool identifying is training in the op. Default to true. +* @brief DynamicGRUV2 calculation. +* @par Inputs: +* seven inputs: +* @li x:Must be one of the following types: float16. +* @li weight_input:Must be one of the following types: float16. +* @li weight_hidden:Must be one of the following types: float16. +* @li bias_input:Must be one of the following types: float16, float32. The format must be ND. +* @li bias_hidden:Must be one of the following types: float16, float32. The format must be ND. +* @li seq_length:Must be one of the following types: int32 in ND. +* @li init_h:Must be one of the following types: float16, float32. -*@par Outputs: -*six outputs: -*@li y:Must be one of the following types: float16, float32. -*@li output_h:Must be one of the following types: float16, float32. -*@li update:Must be one of the following types: float16, float32. -*@li reset:Must be one of the following types: float16, float32. -*@li new:Must be one of the following types: float16, float32. -*@li hidden_new:Must be one of the following types: float16, float32. +* @par Attributes: +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Support "UNIDIRECTIONAL" and "REDIRECTIONAL". +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. +* @li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. +* @li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. +* @li is_training:An bool identifying is training in the op. Default to true. + +* @par Outputs: +* six outputs: +* @li y:Must be one of the following types: float16, float32. +* @li output_h:Must be one of the following types: float16, float32. +* @li update:Must be one of the following types: float16, float32. +* @li reset:Must be one of the following types: float16, float32. +* @li new:Must be one of the following types: float16, float32. +* @li hidden_new:Must be one of the following types: float16, float32. */ REG_OP(DynamicGRUV2) .INPUT(x, TensorType({DT_FLOAT16})) @@ -983,39 +985,39 @@ REG_OP(DynamicGRUV2) /** -*@brief DynamicGRUV2Hidden calculation. -*@par Inputs: -*five inputs: -*@li x_weight_input:Must be one of the following types: float32. -*@li weight_hidden:Must be one of the following types: float16. -*@li bias_hidden:Must be one of the following types: float16, float32. The format must be ND. -*@li seq_length:Must be one of the following types: int32 in ND. -*@li init_h:Must be one of the following types: float16, float32. - -*@par Attributes: -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Support "UNIDIRECTIONAL" and "REDIRECTIONAL". -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". -Only tanh is currently supported. -*@li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. -*@li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. -*@li is_training:An bool identifying is training in the op. Default to true. +* @brief DynamicGRUV2Hidden calculation. +* @par Inputs: +* five inputs: +* @li x_weight_input:Must be one of the following types: float32. +* @li weight_hidden:Must be one of the following types: float16. +* @li bias_hidden:Must be one of the following types: float16, float32. The format must be ND. +* @li seq_length:Must be one of the following types: int32 in ND. +* @li init_h:Must be one of the following types: float16, float32. + +* @par Attributes: +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Support "UNIDIRECTIONAL" and "REDIRECTIONAL". +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". + Only tanh is currently supported. +* @li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. +* @li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. +* @li is_training:An bool identifying is training in the op. Default to true. *@par Outputs: -*six outputs: -*@li y:Must be one of the following types: float16, float32. -*@li output_h:Must be one of the following types: float16, float32. -*@li update:Must be one of the following types: float16, float32. -*@li reset:Must be one of the following types: float16, float32. -*@li new:Must be one of the following types: float16, float32. -*@li hidden_new:Must be one of the following types: float16, float32. - -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* six outputs: +* @li y:Must be one of the following types: float16, float32. +* @li output_h:Must be one of the following types: float16, float32. +* @li update:Must be one of the following types: float16, float32. +* @li reset:Must be one of the following types: float16, float32. +* @li new:Must be one of the following types: float16, float32. +* @li hidden_new:Must be one of the following types: float16, float32. + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(DynamicGRUV2Hidden) .INPUT(x_weight_input, TensorType({DT_FLOAT32})) @@ -1042,235 +1044,237 @@ REG_OP(DynamicGRUV2Hidden) .OP_END_FACTORY_REG(DynamicGRUV2Hidden) /** -*@brief DynamicAUGRU calculation. -*@par Inputs: -*eight inputs: -*@li x:Must be one of the following types: float16. -*@li weight_input:Must be one of the following types: float16. -*@li weight_hidden:Must be one of the following types: float16. -*@li weight_attr:Must be one of the following types: float16. -*@li bias_input:Must be one of the following types: float16, float32. The format must be ND. -*@li bias_hidden:Must be one of the following types: float16, float32. The format must be ND. -*@li seq_length:Must be one of the following types: int32 in ND. -*@li init_h:Must be one of the following types: float16, float32. - -*@par Attributes: -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. -*@li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. -*@li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. -*@li is_training:An bool identifying is training in the op. Default to true. +* @brief DynamicAUGRU calculation. +* @par Inputs: +* eight inputs: +* @li x:Must be one of the following types: float16. +* @li weight_input:Must be one of the following types: float16. +* @li weight_hidden:Must be one of the following types: float16. +* @li weight_attr:Must be one of the following types: float16. +* @li bias_input:Must be one of the following types: float16, float32. The format must be ND. +* @li bias_hidden:Must be one of the following types: float16, float32. The format must be ND. +* @li seq_length:Must be one of the following types: int32 in ND. +* @li init_h:Must be one of the following types: float16, float32. -*@par Outputs: -*seven outputs: -*@li y:Must be one of the following types: float16, float32. -*@li output_h:Must be one of the following types: float16, float32. -*@li update:Must be one of the following types: float16, float32. -*@li update_att:Must be one of the following types: float16, float32. -*@li reset:Must be one of the following types: float16, float32. -*@li new:Must be one of the following types: float16, float32. -*@li hidden_new:Must be one of the following types: float16, float32. +* @par Attributes: +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li activation:An string identifying the type of activation function in the op. Default to "tanh". Only tanh is currently supported. +* @li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. +* @li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. +* @li is_training:An bool identifying is training in the op. Default to true. + +* @par Outputs: +* seven outputs: +* @li y:Must be one of the following types: float16, float32. +* @li output_h:Must be one of the following types: float16, float32. +* @li update:Must be one of the following types: float16, float32. +* @li update_att:Must be one of the following types: float16, float32. +* @li reset:Must be one of the following types: float16, float32. +* @li new:Must be one of the following types: float16, float32. +* @li hidden_new:Must be one of the following types: float16, float32. */ REG_OP(DynamicAUGRU) -.INPUT(x, TensorType({DT_FLOAT16})) -.INPUT(weight_input, TensorType({DT_FLOAT16})) -.INPUT(weight_hidden, TensorType({DT_FLOAT16})) -.INPUT(weight_att, TensorType({DT_FLOAT16})) -.OPTIONAL_INPUT(bias_input, TensorType({DT_FLOAT16, DT_FLOAT})) -.OPTIONAL_INPUT(bias_hidden, TensorType({DT_FLOAT16, DT_FLOAT})) -.OPTIONAL_INPUT(seq_length, TensorType({DT_INT32, DT_FLOAT16})) -.OPTIONAL_INPUT(init_h, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(output_h, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(update, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(update_att, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(reset, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(new, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(hidden_new, TensorType({DT_FLOAT16, DT_FLOAT})) -.ATTR(direction, String, "UNIDIRECTIONAL") -.ATTR(cell_depth, Int, 1) -.ATTR(keep_prob, Float, 1.0) -.ATTR(cell_clip, Float, -1.0) -.ATTR(num_proj, Int, 0) -.ATTR(time_major, Bool, true) -.ATTR(activation, String, "tanh") -.ATTR(gate_order, String, "zrh") -.ATTR(reset_after, Bool, true) -.ATTR(is_training, Bool, true) -.OP_END_FACTORY_REG(DynamicAUGRU) + .INPUT(x, TensorType({DT_FLOAT16})) + .INPUT(weight_input, TensorType({DT_FLOAT16})) + .INPUT(weight_hidden, TensorType({DT_FLOAT16})) + .INPUT(weight_att, TensorType({DT_FLOAT16})) + .OPTIONAL_INPUT(bias_input, TensorType({DT_FLOAT16, DT_FLOAT})) + .OPTIONAL_INPUT(bias_hidden, TensorType({DT_FLOAT16, DT_FLOAT})) + .OPTIONAL_INPUT(seq_length, TensorType({DT_INT32, DT_FLOAT16})) + .OPTIONAL_INPUT(init_h, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(output_h, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(update, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(update_att, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(reset, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(new, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(hidden_new, TensorType({DT_FLOAT16, DT_FLOAT})) + .ATTR(direction, String, "UNIDIRECTIONAL") + .ATTR(cell_depth, Int, 1) + .ATTR(keep_prob, Float, 1.0) + .ATTR(cell_clip, Float, -1.0) + .ATTR(num_proj, Int, 0) + .ATTR(time_major, Bool, true) + .ATTR(activation, String, "tanh") + .ATTR(gate_order, String, "zrh") + .ATTR(reset_after, Bool, true) + .ATTR(is_training, Bool, true) + .OP_END_FACTORY_REG(DynamicAUGRU) /** -*@brief: DynamicAUGRUGrad calculation. -*@par Inputs: -*sixteen inputs: \n -*@li x:A 4D Tensor. Must be one of the following types: float16, float32. -*@li weight_input:A 4D Tensor. Must be one of the following types: float16, float32. -*@li weight_hidden:A 4D Tensor. Must be one of the following types: float16, float32. -*@li weight_att:A 4D Tensor. Must be one of the following types: float16, float32. -*@li y:A 4D Tensor. Must be one of the following types: float16, float32. -*@li init_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dy:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh:A 4D Tensor. Must be one of the following types: float16, float32. -*@li update:A 4D Tensor. Must be one of the following types: float16, float32. -*@li update_att:A 4D Tensor. Must be one of the following types: float16, float32. -*@li reset:A 4D Tensor. Must be one of the following types: float16, float32. -*@li new:A 4D Tensor. Must be one of the following types: float16, float32. -*@li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32. -*@li seq_length:A 4D Tensor. Must be one of the following types: float16, float32. -*@li mask:A 4D Tensor. Must be one of the following types: float16, float32. - -*@par Attributes: -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. -*@li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. +* @brief: DynamicAUGRUGrad calculation. +* @par Inputs: +* sixteen inputs: \n +* @li x:A 4D Tensor. Must be one of the following types: float16, float32. +* @li weight_input:A 4D Tensor. Must be one of the following types: float16, float32. +* @li weight_hidden:A 4D Tensor. Must be one of the following types: float16, float32. +* @li weight_att:A 4D Tensor. Must be one of the following types: float16, float32. +* @li y:A 4D Tensor. Must be one of the following types: float16, float32. +* @li init_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dy:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh:A 4D Tensor. Must be one of the following types: float16, float32. +* @li update:A 4D Tensor. Must be one of the following types: float16, float32. +* @li update_att:A 4D Tensor. Must be one of the following types: float16, float32. +* @li reset:A 4D Tensor. Must be one of the following types: float16, float32. +* @li new:A 4D Tensor. Must be one of the following types: float16, float32. +* @li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32. +* @li seq_length:A 4D Tensor. Must be one of the following types: float16, float32. +* @li mask:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Outputs: -*seven outputs: \n -*@li dw_input:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dw_hidden:A 4D Tensor. Must be one of the following types: float16, float32. -*@li db_input:A 4D Tensor. Must be one of the following types: float16, float32. -*@li db_hidden:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dx:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dw_att:A 4D Tensor. Must be one of the following types: float16, float32. - -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Attributes: +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. +* @li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. + +* @par Outputs: +* seven outputs: \n +* @li dw_input:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dw_hidden:A 4D Tensor. Must be one of the following types: float16, float32. +* @li db_input:A 4D Tensor. Must be one of the following types: float16, float32. +* @li db_hidden:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dx:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dw_att:A 4D Tensor. Must be one of the following types: float16, float32. + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(DynamicAUGRUGrad) -.INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(weight_input, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(weight_hidden, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(weight_att, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(init_h, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(h, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(dh, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(update, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(update_att, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(reset, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(new, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(hidden_new, TensorType({DT_FLOAT16, DT_FLOAT})) -.OPTIONAL_INPUT(seq_length, TensorType({DT_INT32})) -.OPTIONAL_INPUT(mask, TensorType({DT_UINT8})) -.OUTPUT(dw_input, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(dw_hidden, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(db_input, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(db_hidden, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(dx, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(dh_prev, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(dw_att, TensorType({DT_FLOAT16, DT_FLOAT})) -.ATTR(direction, String, "UNIDIRECTIONAL") -.ATTR(cell_depth, Int, 1) -.ATTR(keep_prob, Float, -1.0) -.ATTR(cell_clip, Float, -1.0) -.ATTR(num_proj, Int, 0) -.ATTR(time_major, Bool, true) -.ATTR(gate_order, String, "zrh") -.ATTR(reset_after, Bool, true) -.OP_END_FACTORY_REG(DynamicAUGRUGrad) + .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(weight_input, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(weight_hidden, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(weight_att, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(y, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(init_h, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(h, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(dh, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(update, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(update_att, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(reset, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(new, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(hidden_new, TensorType({DT_FLOAT16, DT_FLOAT})) + .OPTIONAL_INPUT(seq_length, TensorType({DT_INT32})) + .OPTIONAL_INPUT(mask, TensorType({DT_UINT8})) + .OUTPUT(dw_input, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(dw_hidden, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(db_input, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(db_hidden, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(dx, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(dh_prev, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(dw_att, TensorType({DT_FLOAT16, DT_FLOAT})) + .ATTR(direction, String, "UNIDIRECTIONAL") + .ATTR(cell_depth, Int, 1) + .ATTR(keep_prob, Float, -1.0) + .ATTR(cell_clip, Float, -1.0) + .ATTR(num_proj, Int, 0) + .ATTR(time_major, Bool, true) + .ATTR(gate_order, String, "zrh") + .ATTR(reset_after, Bool, true) + .OP_END_FACTORY_REG(DynamicAUGRUGrad) /** -*@brief: AUGRUHiddenGrad calculation. -*@par Inputs: -*eleven inputs: \n -*@li weight_att:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh_pre_t:A 4D Tensor. Must be one of the following types: float16, float32. -*@li init_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dy:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh:A 4D Tensor. Must be one of the following types: float16, float32. -*@li update:A 4D Tensor. Must be one of the following types: float16, float32. -*@li update_att:A 4D Tensor. Must be one of the following types: float16, float32. -*@li reset:A 4D Tensor. Must be one of the following types: float16, float32. -*@li new:A 4D Tensor. Must be one of the following types: float16, float32. -*@li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32. - -*@par Attributes: -*@li t_state:An Int identifying the current t state. Default to [0, 4]. -*@li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. +* @brief: AUGRUHiddenGrad calculation. +* @par Inputs: +* twelve inputs: \n +* @li weight_att:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh_pre_t:A 4D Tensor. Must be one of the following types: float16, float32. +* @li init_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dy:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh:A 4D Tensor. Must be one of the following types: float16, float32. +* @li update:A 4D Tensor. Must be one of the following types: float16, float32. +* @li update_att:A 4D Tensor. Must be one of the following types: float16, float32. +* @li reset:A 4D Tensor. Must be one of the following types: float16, float32. +* @li new:A 4D Tensor. Must be one of the following types: float16, float32. +* @li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32. +* @li seq_mask:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Outputs: -*four outputs: \n -*@li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dgate_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dnt_x:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dw_att_t:A 4D Tensor. Must be one of the following types: float16, float32. - -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Attributes: +* @li t_state:An Int identifying the current t state. Default to [0, 4]. +* @li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. + +* @par Outputs: +* four outputs: \n +* @li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dgate_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dnt_x:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dw_att_t:A 4D Tensor. Must be one of the following types: float16, float32. + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(AUGRUHiddenGradCell) -.INPUT(weight_att, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(dh_pre_t, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(h, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(dh, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(update, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(update_att, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(reset, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(new, TensorType({DT_FLOAT16, DT_FLOAT})) -.INPUT(hidden_new, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(dh_prev, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(dgate_h, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(dnt_x, TensorType({DT_FLOAT16, DT_FLOAT})) -.OUTPUT(dw_att_t, TensorType({DT_FLOAT16, DT_FLOAT})) -.ATTR(t_state, Int, 0) -.ATTR(gate_order, String, "zrh") -.OP_END_FACTORY_REG(AUGRUHiddenGradCell) + .INPUT(weight_att, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(dh_pre_t, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(h, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(dh, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(update, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(update_att, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(reset, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(new, TensorType({DT_FLOAT16, DT_FLOAT})) + .INPUT(hidden_new, TensorType({DT_FLOAT16, DT_FLOAT})) + .OPTIONAL_INPUT(seq_length, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(dh_prev, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(dgate_h, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(dnt_x, TensorType({DT_FLOAT16, DT_FLOAT})) + .OUTPUT(dw_att_t, TensorType({DT_FLOAT16, DT_FLOAT})) + .ATTR(t_state, Int, 0) + .ATTR(gate_order, String, "zrh") + .OP_END_FACTORY_REG(AUGRUHiddenGradCell) /** -*@brief: DynamicGRUV2Grad calculation. -*@par Inputs: -*fourteen inputs: \n -*@li x:A 4D Tensor. Must be one of the following types: float16, float32. -*@li weight_input:A 4D Tensor. Must be one of the following types: float16, float32. -*@li weight_hidden:A 4D Tensor. Must be one of the following types: float16, float32. -*@li y:A 4D Tensor. Must be one of the following types: float16, float32. -*@li init_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dy:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh:A 4D Tensor. Must be one of the following types: float16, float32. -*@li update:A 4D Tensor. Must be one of the following types: float16, float32. -*@li reset:A 4D Tensor. Must be one of the following types: float16, float32. -*@li new:A 4D Tensor. Must be one of the following types: float16, float32. -*@li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32. -*@li seq_length:A 4D Tensor. Must be one of the following types: float16, float32. -*@li mask:A 4D Tensor. Must be one of the following types: float16, float32. - -*@par Attributes: -*@li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. -*@li cell_depth:An integer identifying the cell depth in the op. Default to 1. -*@li keep_prob:An float identifying the keep prob in the op. Default to 1. -*@li cell_clip:An float identifying the cell clip in the op. Default to -1. -*@li num_proj:An integer identifying the num projection in the op. Default to 0. -*@li time_major:An bool identifying the time major in the op. Default to true. -*@li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. -*@li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. +* @brief: DynamicGRUV2Grad calculation. +* @par Inputs: +* fourteen inputs: \n +* @li x:A 4D Tensor. Must be one of the following types: float16, float32. +* @li weight_input:A 4D Tensor. Must be one of the following types: float16, float32. +* @li weight_hidden:A 4D Tensor. Must be one of the following types: float16, float32. +* @li y:A 4D Tensor. Must be one of the following types: float16, float32. +* @li init_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dy:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh:A 4D Tensor. Must be one of the following types: float16, float32. +* @li update:A 4D Tensor. Must be one of the following types: float16, float32. +* @li reset:A 4D Tensor. Must be one of the following types: float16, float32. +* @li new:A 4D Tensor. Must be one of the following types: float16, float32. +* @li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32. +* @li seq_length:A 4D Tensor. Must be one of the following types: float16, float32. +* @li mask:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Outputs: -*six outputs: \n -*@li dw_input:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dw_hidden:A 4D Tensor. Must be one of the following types: float16, float32. -*@li db_input:A 4D Tensor. Must be one of the following types: float16, float32. -*@li db_hidden:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dx:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. - -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Attributes: +* @li direction:An string identifying the direction in the op. Default to "UNIDIRECTIONAL". Only UNIDIRECTIONAL is currently supported. +* @li cell_depth:An integer identifying the cell depth in the op. Default to 1. +* @li keep_prob:An float identifying the keep prob in the op. Default to 1. +* @li cell_clip:An float identifying the cell clip in the op. Default to -1. +* @li num_proj:An integer identifying the num projection in the op. Default to 0. +* @li time_major:An bool identifying the time major in the op. Default to true. +* @li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. +* @li reset_after:An bool identifying whether to apply reset gate after matrix multiplication. Default to true. + +* @par Outputs: +* six outputs: \n +* @li dw_input:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dw_hidden:A 4D Tensor. Must be one of the following types: float16, float32. +* @li db_input:A 4D Tensor. Must be one of the following types: float16, float32. +* @li db_hidden:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dx:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(DynamicGRUV2Grad) .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT})) @@ -1304,31 +1308,31 @@ REG_OP(DynamicGRUV2Grad) .OP_END_FACTORY_REG(DynamicGRUV2Grad) /** -*@brief: GRUV2HiddenGrad calculation. -*@par Inputs: -*nine inputs: \n -*@li dh_pre_t:A 4D Tensor. Must be one of the following types: float16, float32. -*@li init_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dy:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh:A 4D Tensor. Must be one of the following types: float16, float32. -*@li update:A 4D Tensor. Must be one of the following types: float16, float32. -*@li reset:A 4D Tensor. Must be one of the following types: float16, float32. -*@li new:A 4D Tensor. Must be one of the following types: float16, float32. -*@li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32. - -*@par Attributes: -*@li t_state:An Int identifying the current t state. Default to [0, 4]. -*@li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. +* @brief: GRUV2HiddenGrad calculation. +* @par Inputs: +* nine inputs: \n +* @li dh_pre_t:A 4D Tensor. Must be one of the following types: float16, float32. +* @li init_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dy:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh:A 4D Tensor. Must be one of the following types: float16, float32. +* @li update:A 4D Tensor. Must be one of the following types: float16, float32. +* @li reset:A 4D Tensor. Must be one of the following types: float16, float32. +* @li new:A 4D Tensor. Must be one of the following types: float16, float32. +* @li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Outputs: -*three outputs: \n -*@li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dgate_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dnt_x:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Attributes: +* @li t_state:An Int identifying the current t state. Default to [0, 4]. +* @li gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. + +* @par Outputs: +* three outputs: \n +* @li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dgate_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dnt_x:A 4D Tensor. Must be one of the following types: float16, float32. -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(GRUV2HiddenGradCell) .INPUT(dh_pre_t, TensorType({DT_FLOAT16, DT_FLOAT})) @@ -1347,31 +1351,31 @@ REG_OP(GRUV2HiddenGradCell) .OP_END_FACTORY_REG(GRUV2HiddenGradCell) /** -*@brief: DynamicGRUCellGrad calculation. -*@par Inputs: -*ten inputs: \n -*@li dh_pre_t:A 4D Tensor. Must be one of the following types: float16, float32. -*@li h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dy:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dh:A 4D Tensor. Must be one of the following types: float16, float32. -*@li update:A 4D Tensor. Must be one of the following types: float16, float32. -*@li reset:A 4D Tensor. Must be one of the following types: float16, float32. -*@li new:A 4D Tensor. Must be one of the following types: float16, float32. -*@li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32.+ -*@li init_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li t_state:A 1D Tensor. Must be one of the following types: int32. The format must be ND. - -*@par Attributes: -*gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. +* @brief: DynamicGRUCellGrad calculation. +* @par Inputs: +* ten inputs: \n +* @li dh_pre_t:A 4D Tensor. Must be one of the following types: float16, float32. +* @li h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dy:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dh:A 4D Tensor. Must be one of the following types: float16, float32. +* @li update:A 4D Tensor. Must be one of the following types: float16, float32. +* @li reset:A 4D Tensor. Must be one of the following types: float16, float32. +* @li new:A 4D Tensor. Must be one of the following types: float16, float32. +* @li hidden_new:A 4D Tensor. Must be one of the following types: float16, float32.+ +* @li init_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li t_state:A 1D Tensor. Must be one of the following types: int32. The format must be ND. -*@par Outputs: -*three outputs: \n -*@li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dgate_h:A 4D Tensor. Must be one of the following types: float16, float32. -*@li dnt_x:A 4D Tensor. Must be one of the following types: float16, float32. +* @par Attributes: +* gate_order:An string identifying the gate order in weight and bias. Default to "zrh". "rzh" is another option. -*@par Restrictions: -*Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. +* @par Outputs: +* three outputs: \n +* @li dh_prev:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dgate_h:A 4D Tensor. Must be one of the following types: float16, float32. +* @li dnt_x:A 4D Tensor. Must be one of the following types: float16, float32. + +* @par Restrictions: +* Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ REG_OP(DynamicGRUCellGrad) .INPUT(dh_pre_t, TensorType({DT_FLOAT16, DT_FLOAT})) @@ -1424,32 +1428,32 @@ REG_OP(EmbeddingDenseGrad) .OP_END_FACTORY_REG(EmbeddingDenseGrad) /** -*@brief CommonLSTM calculation. -*@par Inputs: -*eight inputs: \n -*@li x:Each time step is a 4D Tensor. Must be one of the following types: float16, float32. -*@li w:Each direction is a 4D Tensor. Must be one of the following types: float16, float32. -*@li r:Each direction is a 4D Tensor. Must be one of the following types: float16, float32. -*@li b:An optional input. Each direction is a 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. -*@li sequence_lens:An optional input. A 1D Tensor.Must be one of the following types: int32. The format must be ND. -*@li initial_h:An optional input. Each direction is a 4D Tensor. Must be one of the following types: float16, float32. -*@li initial_c:An optional input. Each direction is a 4D Tensor. Must be one of the following types: float16, float32. -*@li p:An optional input. Each direction is a 1D Tensor.Must be one of the following types: float16, float32. The format must be ND. - -*@par Attributes: -*@li activation_alpha:Optional scaling values used by some activation functions. Empty is currently supported. -*@li activation_beta:Optional scaling values used by some activation functions. Empty is currently supported. -*@li activations:The list of activation functions. Empty is currently supported. -*@li clip:An float identifying the cell clip in the op. Default to -1. -*@li direction:Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward(default), reverse, or bidirectional. -*@li hidden_size:Number of neurons in the hidden layer. Reserved. -*@li input_forget:Couple the input and forget gates if 1. Reserved. +* @brief CommonLSTM calculation. +* @par Inputs: +* eight inputs: \n +* @li x:Each time step is a 4D Tensor. Must be one of the following types: float16, float32. +* @li w:Each direction is a 4D Tensor. Must be one of the following types: float16, float32. +* @li r:Each direction is a 4D Tensor. Must be one of the following types: float16, float32. +* @li b:An optional input. Each direction is a 1D Tensor. Must be one of the following types: float16, float32. The format must be ND. +* @li sequence_lens:An optional input. A 1D Tensor.Must be one of the following types: int32. The format must be ND. +* @li initial_h:An optional input. Each direction is a 4D Tensor. Must be one of the following types: float16, float32. +* @li initial_c:An optional input. Each direction is a 4D Tensor. Must be one of the following types: float16, float32. +* @li p:An optional input. Each direction is a 1D Tensor.Must be one of the following types: float16, float32. The format must be ND. -*@par Outputs: -*three outputs: \n -*@li y:First dimension is time step, second dimension is direction, others is a 4D Tensor. Must be one of the following types: float16, float32. -*@li y_h:Each direction is a 4D Tensor. Must be one of the following types: float16, float32. -*@li y_c:Each direction is a 4D Tensor. Must be one of the following types: float16, float32. +* @par Attributes: +* @li activation_alpha:Optional scaling values used by some activation functions. Empty is currently supported. +* @li activation_beta:Optional scaling values used by some activation functions. Empty is currently supported. +* @li activations:The list of activation functions. Empty is currently supported. +* @li clip:An float identifying the cell clip in the op. Default to -1. +* @li direction:Specify if the RNN is forward, reverse, or bidirectional. Must be one of forward(default), reverse, or bidirectional. +* @li hidden_size:Number of neurons in the hidden layer. Reserved. +* @li input_forget:Couple the input and forget gates if 1. Reserved. + +* @par Outputs: +* three outputs: \n +* @li y:First dimension is time step, second dimension is direction, others is a 4D Tensor. Must be one of the following types: float16, float32. +* @li y_h:Each direction is a 4D Tensor. Must be one of the following types: float16, float32. +* @li y_c:Each direction is a 4D Tensor. Must be one of the following types: float16, float32. */ REG_OP(CommonLSTM) @@ -1591,13 +1595,13 @@ REG_OP(EmbeddingBag) * @li project: A optional Tensor. Must be one of the following types: float16, float32. * * @par Outputs: - *three outputs: - *@li y:A Tensor. Must be one of the following types: float16, float32. - *@li output_h:A Tensor. Must be one of the following types: float16, float32. - *@li output_c:A Tensor. Must be one of the following types: float16, float32. + * three outputs: + * @li y:A Tensor. Must be one of the following types: float16, float32. + * @li output_h:A Tensor. Must be one of the following types: float16, float32. + * @li output_c:A Tensor. Must be one of the following types: float16, float32. * *@par Attributes: - *time_major:An bool identifying the time major in the op. Default to false. + * time_major:An bool identifying the time major in the op. Default to false. * @par Restrictions: * Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use. */ diff --git a/third_party/fwkacllib/inc/runtime/base.h b/third_party/fwkacllib/inc/runtime/base.h index 85740add..8650f9c4 100644 --- a/third_party/fwkacllib/inc/runtime/base.h +++ b/third_party/fwkacllib/inc/runtime/base.h @@ -92,6 +92,12 @@ typedef enum tagRtLimitType { RT_LIMIT_TYPE_LOW_POWER_TIMEOUT = 0, // timeout for power down , ms } rtLimitType_t; +typedef enum tagRtFloatOverflowMode { + RT_OVERFLOW_MODE_SATURATION = 0, + RT_OVERFLOW_MODE_INFNAN, + RT_OVERFLOW_MODE_UNDEF, +} rtFloatOverflowMode_t; + typedef struct rtExceptionInfo { uint32_t taskid; uint32_t streamid; diff --git a/third_party/fwkacllib/inc/runtime/config.h b/third_party/fwkacllib/inc/runtime/config.h index 0030fea4..f39574b3 100644 --- a/third_party/fwkacllib/inc/runtime/config.h +++ b/third_party/fwkacllib/inc/runtime/config.h @@ -145,12 +145,6 @@ typedef enum tagRTTaskTimeoutType { RT_TIMEOUT_TYPE_OP_EXECUTE, } rtTaskTimeoutType_t; -typedef enum tagRtFloatOverflowMode { - RT_OVERFLOW_MODE_SATURATION = 0, - RT_OVERFLOW_MODE_INFNAN, - RT_OVERFLOW_MODE_UNDEF, -} rtFloatOverflowMode_t; - /** * @ingroup * @brief get AI core count diff --git a/third_party/fwkacllib/inc/runtime/dev.h b/third_party/fwkacllib/inc/runtime/dev.h index 1c4586e7..b1157c2b 100644 --- a/third_party/fwkacllib/inc/runtime/dev.h +++ b/third_party/fwkacllib/inc/runtime/dev.h @@ -433,6 +433,32 @@ RTS_API rtError_t rtGetDevMsg(rtGetDevMsgType_t getMsgType, rtGetMsgCallback cal * @return RT_MEMORY_TS, RT_MEMORY_HBM, RT_MEMORY_TS | RT_MEMORY_POLICY_HUGE_PAGE_ONLY */ RTS_API uint32_t rtGetTsMemType(rtMemRequestFeature_t featureType, uint32_t memSize); + +/** + * @ingroup + * @brief set saturation mode for current device. + * @param [in] saturation mode. + * @return RT_ERROR_NONE for ok + */ +RTS_API rtError_t rtSetDeviceSatMode(rtFloatOverflowMode_t floatOverflowMode); + +/** + * @ingroup + * @brief get saturation mode for current device. + * @param [out] saturation mode. + * @return RT_ERROR_NONE for ok + */ +RTS_API rtError_t rtGetDeviceSatMode(rtFloatOverflowMode_t *floatOverflowMode); + +/** + * @ingroup + * @brief get saturation mode for target stream. + * @param [in] target stm + * @param [out] saturation mode. + * @return RT_ERROR_NONE for ok + */ +RTS_API rtError_t rtGetDeviceSatModeForStream(rtStream_t stm, rtFloatOverflowMode_t *floatOverflowMode); + #if defined(__cplusplus) } #endif diff --git a/third_party/fwkacllib/inc/runtime/kernel.h b/third_party/fwkacllib/inc/runtime/kernel.h index 83dc7a91..85c2d832 100644 --- a/third_party/fwkacllib/inc/runtime/kernel.h +++ b/third_party/fwkacllib/inc/runtime/kernel.h @@ -229,6 +229,8 @@ typedef void (*rtCallback_t)(void *fnData); #define RT_KERNEL_DUMPFLAG (0x02U) #define RT_FUSION_KERNEL_DUMPFLAG (0x04U) #define RT_KERNEL_CUSTOM_AICPU (0x08U) +#define RT_KERNEL_FFTSPLUS_DYNAMIC_SHAPE_DUMPFLAG (0x10U) +#define RT_KERNEL_FFTSPLUS_STATIC_SHAPE_DUMPFLAG (0x20U) // STARS topic scheduler sqe : topic_type #define RT_KERNEL_DEVICE_FIRST (0x10U) diff --git a/third_party/fwkacllib/inc/runtime/mem.h b/third_party/fwkacllib/inc/runtime/mem.h index 3d2b0170..368c6201 100644 --- a/third_party/fwkacllib/inc/runtime/mem.h +++ b/third_party/fwkacllib/inc/runtime/mem.h @@ -391,6 +391,18 @@ RTS_API rtError_t rtMemcpyHostTask(void * const dst, const uint64_t destMax, con RTS_API rtError_t rtMemcpyAsync(void *dst, uint64_t destMax, const void *src, uint64_t cnt, rtMemcpyKind_t kind, rtStream_t stm); +typedef struct rtMemcpyAddrInfo { + uint32_t resv0; + uint32_t resv1; + uint32_t resv2; + uint32_t len; + uint64_t src; + uint64_t dst; +} rtMemcpyAddrInfo; + +RTS_API rtError_t rtMemcpyAsyncPtr(void *memcpyAddrInfo, uint64_t destMax, uint64_t count, + rtMemcpyKind_t kind, rtStream_t stream); + /** * @ingroup dvrt_mem * @brief asynchronized reduce memcpy @@ -407,6 +419,23 @@ RTS_API rtError_t rtMemcpyAsync(void *dst, uint64_t destMax, const void *src, ui RTS_API rtError_t rtReduceAsync(void *dst, uint64_t destMax, const void *src, uint64_t cnt, rtRecudeKind_t kind, rtDataType_t type, rtStream_t stm); +/** + * @ingroup dvrt_mem + * @brief asynchronized reduce memcpy + * @param [in] dst destination address pointer + * @param [in] Max length of destination address memory + * @param [in] src source address pointer + * @param [in] count the number of byte to copy + * @param [in] kind memcpy type + * @param [in] type data type + * @param [in] stm asynchronized task stream + * @param [in] overflowAddr addr of overflow flag + * @return RT_ERROR_NONE for ok + * @return RT_ERROR_INVALID_VALUE for error input + */ +RTS_API rtError_t rtReduceAsyncV2(void *dst, uint64_t destMax, const void *src, uint64_t count, rtRecudeKind_t kind, + rtDataType_t type, rtStream_t stm, void *overflowAddr); + /** * @ingroup dvrt_mem * @brief synchronized memcpy2D diff --git a/third_party/fwkacllib/inc/runtime/rt_ffts_plus.h b/third_party/fwkacllib/inc/runtime/rt_ffts_plus.h index 4b3447df..b136f880 100644 --- a/third_party/fwkacllib/inc/runtime/rt_ffts_plus.h +++ b/third_party/fwkacllib/inc/runtime/rt_ffts_plus.h @@ -17,10 +17,19 @@ extern "C" { #pragma pack(push) #pragma pack (1) +typedef struct tagFftsPlusDumpInfo { + const void *loadDumpInfo; + const void *unloadDumpInfo; + uint32_t loadDumpInfolen; + uint32_t unloadDumpInfolen; +} rtFftsPlusDumpInfo_t; + + typedef struct tagFftsPlusTaskInfo { const rtFftsPlusSqe_t *fftsPlusSqe; const void *descBuf; // include total context size_t descBufLen; // the length of descBuf + rtFftsPlusDumpInfo_t fftsPlusDumpInfo; // used only in the dynamic shape } rtFftsPlusTaskInfo_t; #pragma pack(pop) diff --git a/third_party/fwkacllib/inc/runtime/rt_ffts_plus_define.h b/third_party/fwkacllib/inc/runtime/rt_ffts_plus_define.h index b1a6232a..9b043ee5 100644 --- a/third_party/fwkacllib/inc/runtime/rt_ffts_plus_define.h +++ b/third_party/fwkacllib/inc/runtime/rt_ffts_plus_define.h @@ -110,7 +110,8 @@ typedef struct tagFftsPlusAicAivCtx { // 0-3 bytes uint16_t contextType; uint8_t successorNum; - uint8_t resv : 7; + uint8_t resv : 6; + uint8_t dumpSwitch : 1; uint8_t aten : 1; // 4-7 uint8_t prefetchConfig; @@ -172,7 +173,8 @@ typedef struct tagFftsPlusMixAicAivCtx { // 0-3 bytes uint16_t contextType; uint8_t successorNum; - uint8_t reserved1 : 7; + uint8_t reserved1 : 6; + uint8_t dumpSwitch : 1; uint8_t aten : 1; // 4-7 uint8_t prefetchConfig; @@ -236,7 +238,8 @@ typedef struct tagFftsPlusSdmaCtx { // 0-3 bytes uint16_t contextType; uint8_t successorNum; - uint8_t res1 : 7; + uint8_t res1 : 6; + uint8_t dumpSwitch : 1; uint8_t aten : 1; // 4-7 uint8_t res2; @@ -376,7 +379,8 @@ typedef struct tagFftsPlusAiCpuCtx { // 0-3 bytes uint16_t contextType; uint8_t successorNum; - uint8_t res1 : 7; + uint8_t res1 : 6; + uint8_t dumpSwitch : 1; uint8_t aten : 1; // 4-7 uint8_t res2; diff --git a/third_party/fwkacllib/inc/runtime/rt_stars_define.h b/third_party/fwkacllib/inc/runtime/rt_stars_define.h index 4920ef00..ef18877d 100644 --- a/third_party/fwkacllib/inc/runtime/rt_stars_define.h +++ b/third_party/fwkacllib/inc/runtime/rt_stars_define.h @@ -70,10 +70,27 @@ typedef enum tagFftsPlusType { RT_FFTS_PLUS_TYPE = 4, // FFTS+ mode } rtFftsPlusType_t; +typedef struct tagStarsFftsPlusHeader { + uint8_t type : 6; + uint8_t l1Lock : 1; + uint8_t l1Unlock : 1; + + uint8_t ie : 2; + uint8_t preP : 2; + uint8_t postP : 2; + uint8_t wrCqe : 1; + /* tell mcu if this subgraph is overflow-enabled and mcu will send this flag to aicpu when aicpu ctx is excuted */ + uint8_t overflowEn : 1; + + uint16_t blockDim; + + uint16_t rtStreamId; + uint16_t taskId; +} rtStarsFftsPlusHeader_t; // ffts+ sqe typedef struct tagFftsPlusSqe { // 0-7 bytes - rtStarsSqeHeader_t sqeHeader; + rtStarsSqeHeader_t sqeHeader; // use rtStarsFftsPlusHeader_t instead // 8-11 bytes uint16_t fftsType : 3; uint16_t reserved1 : 9; diff --git a/third_party/fwkacllib/inc/runtime/stream.h b/third_party/fwkacllib/inc/runtime/stream.h index f1fe528b..a6abc8fa 100644 --- a/third_party/fwkacllib/inc/runtime/stream.h +++ b/third_party/fwkacllib/inc/runtime/stream.h @@ -27,6 +27,7 @@ extern "C" { #define RT_STREAM_HEAD (0x20U) #define RT_STREAM_PRIMARY_DEFAULT (0x40U) #define RT_STREAM_PRIMARY_FIRST_DEFAULT (0x80U) +#define RT_STREAM_OVERFLOW (0x100U) /** * @ingroup stream_type @@ -212,6 +213,26 @@ RTS_API rtError_t rtDebugRegisterForStream(rtStream_t stm, uint32_t flag, const */ RTS_API rtError_t rtDebugUnRegisterForStream(rtStream_t stm); +/* + * @ingroup dvrt_stream + * @brief enable or disable stream overflow + * @param [in] stm: stream handle + * @param [in] flag: 0:disable others:enable + * @return RT_ERROR_NONE for ok + * @return RT_ERROR_INVALID_VALUE for error input + */ +RTS_API rtError_t rtSetStreamOverflowSwitch(rtStream_t stm, uint32_t flags); + +/* + * @ingroup dvrt_stream + * @brief get whether overflow of the stream is enable or disable + * @param [in] stm: stream handle + * @param [out] flag: 0:disable others:enable + * @return RT_ERROR_NONE for ok + * @return RT_ERROR_INVALID_VALUE for error input + */ +RTS_API rtError_t rtGetStreamOverflowSwitch(rtStream_t stm, uint32_t *flags); + #if defined(__cplusplus) } #endif diff --git a/third_party/fwkacllib/inc/tdt/tsd_client.h b/third_party/fwkacllib/inc/tdt/tsd_client.h index a6ecffec..b4accbf6 100644 --- a/third_party/fwkacllib/inc/tdt/tsd_client.h +++ b/third_party/fwkacllib/inc/tdt/tsd_client.h @@ -41,6 +41,10 @@ struct InitFlowGwInfo { char_t rsv[128]; }; +typedef enum { + TSD_CAPABILITY_PIDQOS = 0, + TSD_CAPABILITY_BUT +} TsdCapabilityType; /** * @ingroup Open * @brief Used for the Framework process to communicate with the TSDDaemon process, @@ -198,6 +202,36 @@ TDT_LIB_EXPORT uint32_t TsdSetMsprofReporterCallback(const MsprofReporterCallbac * @retval OtherValues Failure */ TDT_LIB_EXPORT uint32_t TsdSetAttr(const char * const attrKey, const char * const attrValue); + +/** +* @ingroup TsdCapabilityGet +* @brief use tsd to get some capability +* +* @par type +* capability type +* +* @par ptr +* the result +* @retval TDT_OK Success +* @retval OtherValues Failure +*/ +TDT_LIB_EXPORT uint32_t TsdCapabilityGet(const uint32_t logicDeviceId, const int32_t type, const uint64_t ptr); + + +/** +* @ingroup GetHdcConctStatus +* @brief used to get hdc connection status +* +* @par logicDeviceId +* logic device id +* +* @par hdcSessStat +* hdc session status, DRV_ERROR_SOCKET_CONNECT or DRV_ERROR_SOCKET_CLOSE +* @retval TDT_OK Success +* @retval OtherValues Failure +*/ +TDT_LIB_EXPORT uint32_t GetHdcConctStatus(const uint32_t logicDeviceId, int32_t *hdcSessStat); + #ifdef __cplusplus } #endif // __cplusplus diff --git a/third_party/fwkacllib/inc/tsd/status.h b/third_party/fwkacllib/inc/tsd/status.h index 1010aefb..e0a9b619 100644 --- a/third_party/fwkacllib/inc/tsd/status.h +++ b/third_party/fwkacllib/inc/tsd/status.h @@ -19,11 +19,11 @@ #include "common/type_def.h" namespace tsd { #ifdef __cplusplus -using TSD_StatusT = uint32_t; + using TSD_StatusT = uint32_t; #else -typedef uint32_t TSD_StatusT; + typedef uint32_t TSD_StatusT; #endif -// success code -constexpr TSD_StatusT TSD_OK = 0U; -} // namespace tsd + // success code + constexpr TSD_StatusT TSD_OK = 0U; +} #endif // INC_TDT_STATUS_H