|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829 |
- /**
- * Copyright 2020 Huawei Technologies Co., Ltd
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
- /*!
- * \file elewise_calculation_ops.h
- * \brief
- */
- #ifndef OPS_BUILT_IN_OP_PROTO_INC_ELEWISE_CALCULATION_OPS_H_
- #define OPS_BUILT_IN_OP_PROTO_INC_ELEWISE_CALCULATION_OPS_H_
- #include "graph/operator_reg.h"
-
- namespace ge {
- /**
- *@brief Adds all input tensors element-wise. \n
-
- *@par Inputs:
- *Dynamic inputs, including:
- *x: A list of Tensor objects, each with same shape and type. The supported types are:
- * float16, float32, double, int32, uint8, int16, int8, complex64, int64,
- * qint8, quint8, qint32, uint16, complex128, uint32, uint64. It's a dynamic input. \n
-
- *@par Attributes:
- *N: An required attribute of type int32, means nums of inputs. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same shape and type as the elements of "x". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AddN.
- */
- REG_OP(AddN)
- .DYNAMIC_INPUT(x, TensorType::NumberType())
- .OUTPUT(y, TensorType::NumberType())
- .REQUIRED_ATTR(N, Int)
- .OP_END_FACTORY_REG(AddN)
-
- /**
- *@brief Calculates the reversed outputs of the function "maximum"
-
- *@par Inputs:
- *Three inputs, including:
- * @li grads: A mutable Tensor. Must be one of the following types:
- * float16, float32, int32.
- * @li x1: A mutable Tensor of the same type as "grads".
- * @li x2: A mutable Tensor of the same type as "grads". \n
-
- *@par Attributes:
- *@li grad_x: An optional bool. Defaults to "True".
- * If "True", "y1" will be output.
- * If "False", "y1" will not be output. \n
-
- *@li grad_y: An optional bool. Defaults to "True".
- * If "True", "y2" will be output.
- * If "False", "y2" will not be output. \n
-
- *@par Outputs:
- * @li y1: A mutable Tensor. Has the same type as "grads".
- * @li y2: A mutable Tensor. Has the same type as "grads". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator MaximumGrad.
- */
- REG_OP(MaximumGrad)
- .INPUT(grads, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .OUTPUT(y1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .OUTPUT(y2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .ATTR(grad_x, Bool, true)
- .ATTR(grad_y, Bool, true)
- .OP_END_FACTORY_REG(MaximumGrad)
-
- /**
- *@brief Calculates the reversed outputs of the function "minimum"
-
- *@par Inputs:
- *Three inputs, including:
- * @li grads: A mutable Tensor. Must be one of the following types:
- * float16, float32, int32.
- * @li x1: A mutable Tensor of the same type as "grads".
- * @li x2: A mutable Tensor of the same type as "grads". \n
-
- *@par Attributes:
- *@li grad_x: An optional bool. Defaults to "True".
- * If "True", "y1" will be output.
- * If "False", "y1" will not be output. \n
-
- *@li grad_y: An optional bool. Defaults to "True".
- * If "True", "y2" will be output.
- * If "False", "y2" will not be output. \n
-
- *@par Outputs:
- * @li y1: A mutable Tensor. Has the same type as "grads".
- * @li y2: A mutable Tensor. Has the same type as "grads". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator MinimumGrad.
- */
- REG_OP(MinimumGrad)
- .INPUT(grads, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .OUTPUT(y1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .OUTPUT(y2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .ATTR(grad_x, Bool, true)
- .ATTR(grad_y, Bool, true)
- .OP_END_FACTORY_REG(MinimumGrad)
-
- /**
- *@brief Cast a tensor form src data type to dst data type. \n
-
- *@par Inputs:
- *One input:
- *x:A Tensor. Must be one of the following types: bool, float16, float, int8, int32, uint32, uint8,
- int64, uint64, int16, uint16, double, complex64, complex128, qint8, quint8, qint16, quint16, qint32.
- For float32 type, the actual calculation on the chip is based on float16. \n
-
- *@par Attributes:
- *dst_type: An required attribute of type int32, specifying the dst data type. \n
-
- *@par Outputs:
- *y:A Tensor. Has the same type as x.
- */
- REG_OP(Cast)
- .INPUT(x, TensorType({DT_BOOL, DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT32, DT_UINT8,
- DT_INT64, DT_UINT64, DT_INT16, DT_UINT16, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128, DT_QINT8, DT_QUINT8, DT_QINT16, DT_QUINT16, DT_QINT32}))
- .OUTPUT(y, TensorType({DT_BOOL, DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT32, DT_UINT8,
- DT_INT64, DT_UINT64, DT_INT16, DT_UINT16, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128, DT_QINT8, DT_QUINT8, DT_QINT16, DT_QUINT16, DT_QINT32}))
- .REQUIRED_ATTR(dst_type, Int)
- .OP_END_FACTORY_REG(Cast)
-
- /**
- *@brief Returns the truth value of (x1 >= x2) element-wise. \n
- *when input is int32 and (x2 - x1) > 2**31 or < -2**31
- *aicore accuracy is not guaranteed \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32,
- * double, int32, int8, uint8, int64, uint16, uint32, uint64.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility:
- * Compatible with the TensorFlow operator GreaterEqual.
- */
- REG_OP(GreaterEqual)
- .INPUT(x1, TensorType::RealNumberType())
- .INPUT(x2, TensorType::RealNumberType())
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(GreaterEqual)
-
- /**
- *@brief Returns the truth value of (x1 < x2) element-wise. \n
- *when input is int32 and (x2 - x1) > 2**31 or < -2**31
- *aicore accuracy is not guaranteed \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32, double, int32,
- * uint8, int16, int8, int64, uint16, uint32, uint64.
- * @li x2: A Tensor with the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor of type bool. \n
-
- *@par Third-party framework compatibility:
- * Compatible with TensorFlow operator Less.
- */
- REG_OP(Less)
- .INPUT(x1, TensorType::RealNumberType())
- .INPUT(x2, TensorType::RealNumberType())
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(Less)
-
- /**
- *@brief Returns x1/x2 element-wise for real types. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x1: A Tensor. Must be one of the following types: float16, float32, double, uint16,
- int8, uint8, int16, int32, int64, complex64, DT_COMPLEX128.
- *@li x2: A Tensor. Must be one of the following types: float16, float32, double, uint16,
- int8, uint8, int16, int32, int64, complex64, DT_COMPLEX128. \n
-
- *@par Outputs:
- * y: A Tensor. Has the same type and format as input "x1". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator RealDiv.
- */
- REG_OP(RealDiv)
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_UINT8, DT_INT8,
- DT_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_UINT8, DT_INT8,
- DT_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_UINT8, DT_INT8,
- DT_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(RealDiv)
-
- /**
- *@brief Computes square root of x element-wise. \n
-
- *@par Inputs:
- * x: A Tensor. Must be one of the following types: float16, float32, complex128, complex64, float64. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x".
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Sqrt.
- */
- REG_OP(Sqrt)
- .INPUT(x, TensorType{(DT_FLOAT. DT_FLOAT16, DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128)})
- .OUTPUT(y, TensorType{(DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128)})
- .OP_END_FACTORY_REG(Sqrt)
-
- /**
- *@brief Returns the max of "x" and "y" (i.e. x > y ? x: y) element-wise. \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32, double, int32, int64.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Maximum.
- */
- REG_OP(Maximum)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32,
- DT_INT64}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32,
- DT_INT64}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32,
- DT_INT64}))
- .OP_END_FACTORY_REG(Maximum)
-
- /**
- *@brief Returns the min of x and y (i.e. x1 < x2 ? x1 : x2) element-wise. \n
-
- *@par Inputs:
- *Two inputs, include:
- * @li x1: A Tensor. Must be one of the following types: float32, float16, double, int32, int64.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor of the same type as "x1". \n
-
- *@par Third-party framework compatibility:
- * Compatible with the TensorFlow operator Minimum.
- */
- REG_OP(Minimum)
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_INT32,
- DT_INT64}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_INT32,
- DT_INT64}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_INT32,
- DT_INT64}))
- .OP_END_FACTORY_REG(Minimum)
-
- /**
- *@brief: Computes the reciprocal of "x". \n
-
- *@par Inputs:
- *One inputs, include:
- *x:A Tensor of type float16, float32, int32, int64, double,
- * complex64, complex128.the format can be [NCHW,NC1HWC0,NHWC,ND,NCHW,NC1HWC0,NHWC,ND]
-
- *@par Outputs:
- *y:A Tensor with same type as "x". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Reciprocal.
- */
- REG_OP(Reciprocal)
- .INPUT(x, TensorType({DT_FLOAT, DT_DOUBLE, DT_INT32, DT_INT64, DT_FLOAT16,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_DOUBLE, DT_INT32, DT_INT64, DT_FLOAT16
- DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Reciprocal)
-
- /**
- *@brief Returns x - y element-wise.
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: int8, int16, int32, int64, uint8, float64,
- * float16, float32, complex128, complex64, uint16.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x".
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Subtract.
- */
- REG_OP(Sub)
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_UINT8, DT_INT8,
- DT_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_UINT8, DT_INT8,
- DT_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_UINT8, DT_INT8,
- DT_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Sub)
-
- /**
- *@brief computes the absolute value of a tensor. \n
-
- *@par Inputs:
- *One input, including: \n
- *x: A Tensor. Must be one of the following types: float16, float32, double, int32, int64. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Abs.
- */
- REG_OP(Abs)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32, DT_INT64}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32, DT_INT64}))
- .OP_END_FACTORY_REG(Abs)
-
- /**
- *@brief Computes gradients for absolute operation. \n
-
- *
- *@par Inputs:
- *@li y: A tensor of type float16 or float32.
- *@li dy: A tensor of the same type as "y".
- *
- *@attention Constraints:
- * "dy" has the same type as "y".
- *
- *@par Outputs:
- * z: A tensor. Has the same type as "y".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AbsGrad.
- *
- */
- REG_OP(AbsGrad)
- .INPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OUTPUT(z, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OP_END_FACTORY_REG(AbsGrad)
-
- /**
- *@brief: Computes the sign of "x". \n
-
- *@par Inputs:
- *x:An ND Tensor of type float16, float32, int32, int64, double,
- * complex64, complex128. \n
-
- *@par Outputs:
- *y:An ND Tensor with same type as "x". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Sign.
- */
- REG_OP(Sign)
- .INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT, DT_DOUBLE, DT_INT32,
- DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32,
- DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Sign)
-
- /**
- *@brief Returns (x1 - x2)(x1 - x2) element-wise. \n
-
- *@par Inputs:
- *Two inputs, including: \n
- *@li x1: A Tensor. Must be one of the following types: float16, float32, float64, int32, int64, complex64,complex128
- *@li x2: A Tensor. Has the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator SquaredDifference.
- */
- REG_OP(SquaredDifference)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32,
- DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32,
- DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32,
- DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(SquaredDifference)
-
- /**
- *@brief Computes cosine of "x" element-wise. \n
-
- *@par Inputs:
- *x: A Tensor of type float16, float32, double, complex64, complex128.
- * the format can be [NCHW,NC1HWC0,NHWC,ND]
-
- *@par Outputs:
- *y: A Tensor of the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Cos. \n
-
- */
- REG_OP(Cos)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Cos)
-
- /**
- *@brief Returns x1/x2 element-wise. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x1: A Tensor. Must be one of the following types:
- * float16, float32, int32, int8, uint8, float64, int64, uint16, int16,
- * complex64, complex128, the format can be [NCHW,NC1HWC0,NHWC,ND].
- *@li x2: A Tensor. Has the same type and format as input "x1". \n
-
- *@par Outputs:
- * y: A Tensor. Has the same type and format as input "x1". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Div.
- */
- REG_OP(Div)
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT8, DT_UINT8, DT_INT32,
- DT_DOUBLE, DT_INT64, DT_UINT16, DT_INT16,
- DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT8, DT_UINT8, DT_INT32,
- DT_DOUBLE, DT_INT64, DT_UINT16, DT_INT16,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT8, DT_UINT8, DT_INT32,
- DT_DOUBLE, DT_INT64, DT_UINT16, DT_INT16,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Div)
-
- /**
- *@brief: Returns the truth value of (x = y) element-wise. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x1: A Tensor. Must be one of the following types:
- * float16, float32, int32, int8, uint8, double, int16, int64, complex64,
- * complex128, quint8, qint8, qint32, string, bool. the format can be
- * [NCHW, NC1HWC0, NHWC, ND]
- *@li x2: A Tensor of the same type and format as "x1". \n
-
- *@par Outputs:
- *y: A Tensor of type bool. \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Equal.
- */
- REG_OP(Equal)
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8, DT_UINT8,
- DT_DOUBLE, DT_INT16, DT_INT64, DT_COMPLEX64,
- DT_COMPLEX128, DT_QUINT8, DT_QINT8, DT_QINT32,
- DT_STRING, DT_BOOL}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8, DT_UINT8,
- DT_DOUBLE, DT_INT16, DT_INT64, DT_COMPLEX64,
- DT_COMPLEX128, DT_QUINT8, DT_QINT8, DT_QINT32,
- DT_STRING, DT_BOOL}))
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(Equal)
-
- /**
- *@brief Computes the exponential of "x" element-wise. \n
-
- *@par Inputs:
- *One input:\n
- *x: A Tensor. Must be one of the following types: float16, float32, double, complex64, complex128. \n
-
- *@par Attributes:
- *@li base: An optional attribute of type float32, specifying the base gamma. Defaults to "-1.0".
- *@li scale: An optional attribute of type float32, specifying the scale alpha. Defaults to "1.0".
- *@li shift: An optional attribute of type float32, specifying the shift beta. Defaults to "0.0". \n
-
- *@par Outputs:
- *y: A Tensor of the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator Exp.
- */
- REG_OP(Exp)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .ATTR(base, Float, -1.0)
- .ATTR(scale, Float, 1.0)
- .ATTR(shift, Float, 0.0)
- .OP_END_FACTORY_REG(Exp)
-
- /**
- *@brief Computes the exp(x) - 1 element-wise, y = e^x - 1. \n
-
- *@par Inputs:
- *One input:
- *x: A Tensor. Must be one of the following types: float16, float32, double, complex64, complex128. \n
-
- *@par Outputs:
- *y: A Tensor of the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator Expm1.
- */
- REG_OP(Expm1)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Expm1)
-
- /**
- *@brief: Computes the reciprocal of "x". \n
-
- *@par Inputs:\n
- *x: A Tensor. Must be one of the following types: float16, float32, int32, int64, double, complex64, complex128. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Inv.
- */
- REG_OP(Inv)
- .INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT,DT_DOUBLE,DT_INT32,DT_INT64,DT_COMPLEX64,DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16,DT_FLOAT,DT_INT32}))
- .OP_END_FACTORY_REG(Inv)
-
- /**
- *@brief: Computes "x" reciprocal grad, dx = -1*dy*y*y, where, "y = 1/x", and "dy"
- is the corresponding input gradient. \n
-
- *@par Inputs:
- * Two inputs, including:
- * @li x: A Tensor. Must be one of the following types: float16, float32, int32, int8.
- * @li grad: A Tensor. Has the same type as "x". \n
-
- *@par Outputs:
- *y: A Tensor, Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator InvGrad.
- */
- REG_OP(InvGrad)
- .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .INPUT(grad, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .OP_END_FACTORY_REG(InvGrad)
-
- /**
- *@brief: Returns the truth value of (x <= y) element-wise. \n
- *when input is int32 and (x2 - x1) > 2**31 or < -2**31
- *aicore accuracy is not guaranteed \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x1: A Tensor. Must be one of the following types: float32, float64,
- * int32, uint8, int16, int8, int64, qint8, quint8, qint32, uint16,
- * float16, uint32, uint64.
- *@li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor of type bool. \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator LessEqual.
- */
- REG_OP(LessEqual)
- .INPUT(x1, TensorType::RealNumberType())
- .INPUT(x2, TensorType::RealNumberType())
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(LessEqual)
-
- /**
- *@brief Computes the logarithm of (x + 1) element-wise, y = ln(x + 1). \n
-
- *@par Inputs:
- *One input:\n
- *x: A Tensor. Must be one of the following types: float16, float32, double, complex64, complex128. \n
-
- *@par Outputs:
- *y: A Tensor of the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator Log1p.
- */
- REG_OP(Log1p)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Log1p)
-
- /**
- *@brief Returns element-wise remainder of division.
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32,
- * int32, int64, int8, uint8, double.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1".
-
- *@attention Constraints:
- *@li x2: The input data does not support 0
- *@li When NUM exceeds 2048 , the accuracy of operator cannot guarantee the
- *requirement of double thousandths in the mini form
- *@li Due to different architectures, the calculation results of this operator
- *on NPU and CPU may be inconsistent
- *@li If shape is expressed as (D1,D2... ,Dn), then D1*D2... *DN<=1000000,n<=8
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Mod.
- */
- REG_OP(Mod)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT8, DT_UINT8,
- DT_INT64, DT_DOUBLE}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT8, DT_UINT8,
- DT_INT64, DT_DOUBLE}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT8, DT_UINT8,
- DT_INT64, DT_DOUBLE}))
- .OP_END_FACTORY_REG(Mod)
-
- /**
- *@brief: Returns the truth value of (x != y) element-wise. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x1: A Tensor. Must be one of the following types: float16, float32, int32,
- * int8, uint8, double, int16, int64, uint16, half, uint32, uint64
- *@li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor of type bool. \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator NotEqual.
- */
- REG_OP(NotEqual)
- .INPUT(x1, TensorType::RealNumberType())
- .INPUT(x2, TensorType::RealNumberType())
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(NotEqual)
-
- /**
- *@brief Computes numerical negative value element-wise (y = -x)
-
- *@par Inputs:
- * One input:
- *x: A Tensor. Must be one of the following types: float16, float32, int32,
- * int64, complex64, complex128. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type and format as input "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Neg.
- */
- REG_OP(Neg)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Neg)
-
- /**
- *@brief Returns x1/x2 element-wise for integer types. \n
-
- *@par Inputs:
- *@li x1: A Tensor. Must be one of the following types:
- * float32, float64, int32, uint8, int16, int8,
- * complex64, int64, qint8, quint8, qint32, uint16,
- * complex128, float16, uint32, uint64, complex64, complex128.
- *@li x2: A Tensor of the same data type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1".
-
- *@attention Constraints:
- * Broadcasting is supported. \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator TruncateDiv. \n
-
- */
- REG_OP(TruncateDiv)
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT8, DT_UINT8, DT_INT32,
- DT_DOUBLE, DT_UINT16, DT_INT16, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT8, DT_UINT8, DT_INT32,
- DT_DOUBLE, DT_UINT16, DT_INT16, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT8, DT_UINT8, DT_INT32,
- DT_DOUBLE, DT_UINT16, DT_INT16, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(TruncateDiv)
-
- /**
- *@brief Computes x1/x2 element-wise, if x1 == 0, return 0.
-
- *@par Inputs:
- * Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32,
- * double, complex64, complex128.
- * @li x2: A Tensor. Has the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator Xdivy.
- */
- REG_OP(Xdivy)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Xdivy)
-
- /**
- *@brief Computes "x" multiplied by the logarithm of y element-wise,
- * if "x" == 0, return "0". \n
-
- *@par Inputs:
- * Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32,
- * double, complex64, complex128.
- * @li x2: A Tensor. Has the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator Xlogy.
- */
- REG_OP(Xlogy)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Xlogy)
-
- /**
- *@brief Computes square of "x" element-wise. \n
-
- *@par Inputs:
- *One input: \n
- *x: A Tensor. Must be one of the following types: float16, float32, float64, int32, int64, complex64, complex128
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator Square.
- */
- REG_OP(Square)
- .INPUT(x, TensorType({DT_DOUBLE, DT_FLOAT16, DT_FLOAT,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_DOUBLE, DT_FLOAT16, DT_FLOAT,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Square)
-
-
- /**
- *@brief Computes reciprocal of square root of "x" element-wise: y = 1/sqrt{x}. \n
-
- *
- *@par Inputs:
- * x: An ND or 5HD tensor. Must be one of the following types: float, double, half,
- * complex64, complex128.
- *
- *@par Outputs:
- * y: An ND or 5HD tensor. Has the same type as "x".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Rsqrt.
- *
- */
- REG_OP(Rsqrt)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Rsqrt)
-
- /**
- *@brief Computes the trignometric inverse sine of "x" element-wise. \n
-
- *
- *@par Inputs:
- * x: A tensor. Must be one of the following types: float16, float32, float64, int32, int64, complex64, complex128.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Asin.
- *
- */
- REG_OP(Asin)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Asin)
-
- /**
- *@brief Computes gradients for Asin operation. \n
-
- *
- *@par Inputs:
- *@li y: A tensor of type float16, float32, float64, int32, int64, complex64, complex128.
- *@li dy: A tensor of the same type as "y".
- *
- *@attention Constraints:
- * "dy" has the same type as "y".
- *
- *@par Outputs:
- * z: A tensor. Has the same type as "y".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AsinGrad.
- *
- */
- REG_OP(AsinGrad)
- .INPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(z, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(AsinGrad)
-
- /**
- *@brief Computes acos of x element-wise. \n
-
- *
- *@par Inputs:
- * x: A tensor. Must be one of the following types: float16, float32, float64, int32, int64, complex64, complex128.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Acos.
- *
- */
- REG_OP(Acos)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE,
- DT_INT32, DT_INT64, DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Acos)
-
- /**
- *@brief Computes gradients for Acos operation. \n
-
- *
- *@par Inputs:
- *@li y: A tensor of type float16 or float32.
- *@li dy: A tensor of the same type as "y".
- *
- *@attention Constraints:
- * "dy" has the same shape as "y".
- *
- *@par Outputs:
- * z: A tensor. Has the same type as "y".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AcosGrad.
- *
- */
- REG_OP(AcosGrad)
- .INPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OUTPUT(z, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OP_END_FACTORY_REG(AcosGrad)
-
- /**
- *@brief Computes inverse hyperbolic cosine of x element-wise. \n
-
- *
- *@par Inputs:
- * x: A tensor. Must be one of the following types: float16, float32, float64, complex64, complex128.
- *
- *@attention Constraints:
- * x Given an input tensor, the function computes inverse hyperbolic cosine of every element.\n
- * Input range is [1, inf].
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Acosh.
- *
- */
- REG_OP(Acosh)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Acosh)
-
- /**
- *@brief Computes gradients for Acosh operation. \n
-
- *
- *@par Inputs:
- *@li y: A tensor of type float16 or float32.
- *@li dy: A tensor of the same type as "y".
- *
- *@attention Constraints:
- * "dy" has the same type as "y".
- *
- *@par Outputs:
- * z: A tensor. Has the same type as "y".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AcoshGrad.
- *
- */
- REG_OP(AcoshGrad)
- .INPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OUTPUT(z, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OP_END_FACTORY_REG(AcoshGrad)
-
- /**
- *@brief Returns the truth value of x1 OR x2 element-wise. \n
-
- *
- *@par Inputs:
- *@li x1: A tensor of type bool.
- *@li x2: A tensor of the same type as "x1".
- *
- *@attention Constraints:
- * LogicalOr supports broadcasting.
- *
- *@par Outputs:
- * y: A tensor of the same type as "x1".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator LogicalOr.
- *
- */
- REG_OP(LogicalOr)
- .INPUT(x1, TensorType({DT_BOOL}))
- .INPUT(x2, TensorType({DT_BOOL}))
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(LogicalOr)
-
- /**
- *@brief Returns the truth value of x1 AND x2 element-wise. \n
-
- *
- *@par Inputs:
- *@li x1: A tensor of type bool.
- *@li x2: A tensor of the same type as "x1".
- *
- *@attention Constraints:
- * LogicalAnd supports broadcasting.
- *
- *@par Outputs:
- * y: A tensor of the same type as "x1".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator LogicalAnd.
- *
- */
- REG_OP(LogicalAnd)
- .INPUT(x1, TensorType({DT_BOOL}))
- .INPUT(x2, TensorType({DT_BOOL}))
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(LogicalAnd)
-
- /**
- *@brief Computes the Bessel i0e function of "x" element-wise.
- * Exponentially scaled modified Bessel function of order 0
- * defined as: bessel_i0e(x) = exp(-abs(x)) bessel_i0(x).
- * This function is faster and numerically stabler than "bessel_i0(x)".
- *
- *@par Inputs:
- * x: A tensor of type float16, float32, or float64.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator BesselI0e.
- *
- */
- REG_OP(BesselI0e)
- .INPUT(x, TensorType::FloatingDataType())
- .OUTPUT(y, TensorType::FloatingDataType())
- .OP_END_FACTORY_REG(BesselI0e)
-
- /**
- *@brief Computes the Bessel i1e function of "x" element-wise.
- * Exponentially scaled modified Bessel function of order 0
- * defined as: bessel_i1e(x) = exp(-abs(x)) bessel_i1(x).
- * This function is faster and numerically stabler than "bessel_i1(x)".
- *
- *@par Inputs:
- * x: A tensor of type float16, float32, or float64.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator BesselI1e.
- *
- */
- REG_OP(BesselI1e)
- .INPUT(x, TensorType::FloatingDataType())
- .OUTPUT(y, TensorType::FloatingDataType())
- .OP_END_FACTORY_REG(BesselI1e)
-
- /**
- * @brief Computes logarithm of x element-wise.
- * y = log_base(shift + scale * x), with "base" > 0. \n
-
- * @par Inputs:
- * x: A Tensor of type complex64, complex128, float16, float32 or double. \n
-
- * @par Attributes:
- * @li base: An optional float32, specifying the base "e". Defaults to "-1.0"
-
- * @li scale: An optional float32, specifying the scale of input "x". Defaults
- * to "1.0"
- * @li shift: An optional float32, specifying the shift. Defaults to "0.0"
-
- * @par Outputs:
- * y: A Tensor has same type as "x". \n
-
- * @attention Constraints:
- * @li "base" is supposed to be greater than 0. Retaining the default
- * value "-1" sets "base" to "e".
- * @li If the input value of operator Log is within the range (0, 0.01] or
- * [0.95, 1.05], the output accuracy is subject to change. \n
-
- * @par Third-party framework compatibility
- * @li Compatible with the TensorFlow operator Log.
- * @li Compatible with the Caffe operator Log.
- */
- REG_OP(Log)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .ATTR(base, Float, -1.0)
- .ATTR(scale, Float, 1.0)
- .ATTR(shift, Float, 0.0)
- .OP_END_FACTORY_REG(Log)
-
- /**
- * @brief Returns x1 * x2 element-wise.
- * y = x1 * x2
-
- * @par Inputs:
- * @li x1: A Tensor. Must be one of the following types: float16, float32,
- * float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128.
- * @li x2: A Tensor. Must be one of the following types: float16, float32,
- * float64, uint8, int8, uint16, int16, int32, int64, complex64, complex128. \n
-
- * @par Outputs:
- * y: A Tensor. Must be one of the following types: float16, float32, float64,
- * uint8, int8, uint16, int16, int32, int64, complex64, complex128. \n
-
- * @attention Constraints:
- * "x1" and "x2" have incompatible shapes or types. \n
-
- * @par Third-party framework compatibility
- * Compatible with the TensorFlow operator Multiply.
- */
- REG_OP(Mul)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_UINT8, DT_INT8,
- DI_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_UINT8, DT_INT8,
- DI_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_UINT8, DT_INT8,
- DI_UINT16, DT_INT16, DT_INT32, DT_INT64,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Mul)
-
- /**
- * @brief Computes the gradient of the square root of "x" with regard to its
- * input. grad = dy * 0.5/y, where y = sqrt(x), and "dy" is the corresponding
- * input gradient. \n
-
- * @par Inputs:
- * Two inputs, including:
- * @li y: A Tensor of type float32 or float16.
- * @li dy: A Tensor. Has the same type as "y". \n
-
- * @par Outputs:
- * z: A Tensor. Has the same type as "y". \n
-
- * @attention Constraints:
- * "dy" has the same shape and type as "y".
- */
- REG_OP(SqrtGrad)
- .INPUT(y, TensorType(UnaryDataType))
- .INPUT(dy, TensorType(UnaryDataType))
- .OUTPUT(z, TensorType(UnaryDataType))
- .OP_END_FACTORY_REG(SqrtGrad)
-
- /**
- *@brief Returns x + y element-wise.
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: int8, int16, int32, int64, uint8, float64,
- * float16, float32, complex128, complex64, string.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x".
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Add.
- */
- REG_OP(Add)
- .INPUT(x1, TensorType({DT_FLOAT, DT_INT32, DT_INT64, DT_FLOAT16, DT_INT16,
- DT_INT8, DT_UINT8, DT_DOUBLE, DT_COMPLEX128,
- DT_COMPLEX64, DT_STRING}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_INT32, DT_INT64, DT_FLOAT16, DT_INT16,
- DT_INT8, DT_UINT8, DT_DOUBLE, DT_COMPLEX128,
- DT_COMPLEX64, DT_STRING}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_INT32, DT_INT64, DT_FLOAT16, DT_INT16,
- DT_INT8, DT_UINT8, DT_DOUBLE, DT_COMPLEX128,
- DT_COMPLEX64, DT_STRING}))
- .OP_END_FACTORY_REG(Add)
-
- /**
- *@brief Confuse broadcast, add and mul. \n
-
- *@par Inputs:
- *Five inputs, including:
- * @li x1: A Tensor. Must be one of the following types:int32 float16, float32.
- * @li x2: A Tensor of the same type as "x1".
- * @li x3: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *@li y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility:
- * Compatible with the TensorFlow operator LRN.
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
-
- REG_OP(FusedMulAdd)
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .INPUT(x3, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32}))
- .OP_END_FACTORY_REG(FusedMulAdd)
-
- /**
- *@brief Returns x1 + x2 element-wise. \n
-
- *
- *@par Inputs:
- *@li x1: A tensor. Must be one of the following types: float16, float32, float64, uint8, int8, int16, int32, int64, complex64, complex128.
- *@li x2: A tensor of the same type as "x1".
- *
- *@attention Constraints:
- * AddV2 supports broadcasting.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x1".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AddV2.
- *
- */
- REG_OP(AddV2)
- .INPUT(x1, TensorType({DT_FLOAT, DT_INT32, DT_INT64, DT_FLOAT16, DT_INT16,
- DT_INT8, DT_UINT8, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_INT32, DT_INT64, DT_FLOAT16, DT_INT16,
- DT_INT8, DT_UINT8, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_INT32, DT_INT64, DT_FLOAT16, DT_INT16,
- DT_INT8, DT_UINT8, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128}))
- .OP_END_FACTORY_REG(AddV2)
-
- /**
- *@brief Updates "ref" by adding "value" to it. \n
-
- *@par Inputs:
- *@li ref: A Tensor. Must be one of the following types: float16, float32, int8, int16, int32, int64, uint8, uint16, uint32, uint64.
- *@li value: A Tensor of the same type as "ref". \n
-
- *@par Attributes:
- *use_locking: An optional bool. Defaults to "False".
- If "True", the addition will be protected by a lock;
- otherwise the behavior is undefined, but may exhibit less contention.
- * This attribute is reserved. \n
-
- *@par Outputs:
- *ref: A Tensor that holds the new value of ref after the value has been added. \n
-
- *@attention Constraints:
- *An input tensor of type int64 must have a shape with size 1. \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AssignAdd.
- */
- REG_OP(AssignAdd)
- .INPUT(ref, TensorType::BasicType())
- .INPUT(value,TensorType::BasicType())
- .OUTPUT(ref, TensorType::BasicType())
- .ATTR(use_locking, Bool, false)
- .OP_END_FACTORY_REG(AssignAdd)
-
- /**
- *@brief Updates "ref" by assigning "value" to it. \n
-
- *@par Inputs:
- *@li ref: A Tensor. Must be one of the following types: float16, float32, int8, int16, int32, int64, uint8, uint16, uint32, uint64.
- *@li value: A Tensor of the same type as "ref". \n
-
- *@par Attributes:
- *@li validate_shape: An optional bool. Defaults to "true".
- If "true", the operation will validate that the shape of "value" matches the shape of the Tensor being assigned to.
- * If "false", "ref" will take on the shape of "value".
- * This attribute is reserved.
- *@li use_locking: An optional bool. Defaults to True.
- If True, the assignment will be protected by a lock;
- otherwise the behavior is undefined, but may exhibit less contention.
- * This attribute is reserved. \n
-
- *@par Outputs:
- *ref: A Tensor that holds the new value of ref after the value has been assigned. \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Assign.
- */
- REG_OP(Assign)
- .INPUT(ref, TensorType::BasicType())
- .INPUT(value,TensorType::BasicType())
- .OUTPUT(ref, TensorType::BasicType())
- .ATTR(validate_shape, Bool, true)
- .ATTR(use_locking, Bool, false)
- .OP_END_FACTORY_REG(Assign)
-
- /**
- *@brief Updates "var" by subtracting "value" from it.\n
- * This operation outputs "var" after the update is done. \n
- * This makes it easier to chain operations that need to use the reset value. \n
-
- *
- *@par Inputs:
- *@li var: A tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, complex64, int64, qint8, quint8, qint32, uint16, complex128, uint32, uint64
- *@li value: A tensor of the same type as "var".
- *
- *@par Attributes:
- * use_locking: An optional bool. Defaults to "False". If "True", the subtraction will be protected \n
- * by a lock; otherwise the behavior is undefined, but may exhibit less contention.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "var".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AssignSub.
- *
- */
- REG_OP(AssignSub)
- .INPUT(var, TensorType::NumberType())
- .INPUT(value,TensorType::NumberType())
- .OUTPUT(var, TensorType::NumberType())
- .ATTR(use_locking, Bool, false)
- .OP_END_FACTORY_REG(AssignSub)
-
- /**
- *@brief: Computes the backpropagation of the square root operation. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li y: An NCHW, NC1HWC0, NHWC, ND Tensor. Must be one of the following types: \
- * float, int32, int8, double, complex64, complex128, half.
- *@li dy: A Tensor of the same type and format as "y". \n
-
- *@par Outputs:
- *z: A Tensor of the same type and format as "y". \n
-
- *@see Matmul() | Rsqrt ()
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator RsqrtGrad.
- */
- REG_OP(RsqrtGrad)
- .INPUT(y, TensorType({UnaryDataType,int32,int8}))
- .INPUT(dy, TensorType({UnaryDataType,int32,int8}))
- .OUTPUT(z, TensorType({UnaryDataType,int32,int8}))
- .OP_END_FACTORY_REG(RsqrtGrad)
-
- /**
- *@brief Computes hyperbolic sine of "x" element-wise. \n
-
- *@par Inputs:
- *x: An NCHW, NC1HWC0, NHWC,or ND Tensor of type float, double, complex64,
- * complex128, half. \n
-
- *@par Outputs:
- *y: A NCHW, NC1HWC0, NHWC,or ND Tensor of type float, double, complex64,
- * complex128, half. \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Sinh. \n
-
- */
- REG_OP(Sinh)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Sinh)
-
- /**
- *@brief: Clips tensor values to a specified min and max. \n
-
- *@par Inputs:
- * Three inputs, including:
- *@li x: A Tensor of type float32, float64, int32, uint8, int16, int8, complex64, int64,
- *qint8, quint8, qint32, uint16, complex128, float16, uint32, uint64.
- *@li clip_value_min: A Tensor of the same type as "x".
- *@li clip_value_max: A Tensor of the same type as "x". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator ClipByValue.
- */
- REG_OP(ClipByValue)
- .INPUT(x, TensorType::NumberType())
- .INPUT(clip_value_min, TensorType::NumberType())
- .INPUT(clip_value_max, TensorType::NumberType())
- .OUTPUT(y, TensorType::NumberType())
- .OP_END_FACTORY_REG(ClipByValue)
-
- /**
- *@brief Computes cosine of "x" element-wise. \n
-
- *@par Inputs:
- *x: A Tensor of type float16, float32, double, complex64, complex128.
- * the format can be [NCHW,NC1HWC0,NHWC,ND]. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Cosh. \n
-
- */
- REG_OP(Cosh)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Cosh)
-
- /**
- *@brief: Returns 0 if the denominator is zero, else, like Div. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x1: A Tensor. Must be one of the following types:float16, float32, int32,
- * int8, uint8, double, the format can be [NCHW,NC1HWC0,NHWC,ND].
- *@li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator DivNoNan.
- */
- REG_OP(DivNoNan)
- .INPUT(x1, TensorType({DT_FLOAT, DT_UINT8, DT_INT8, DT_INT32, DT_FLOAT16,
- DT_DOUBLE}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_UINT8, DT_INT8, DT_INT32, DT_FLOAT16,
- DT_DOUBLE}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_UINT8, DT_INT8, DT_INT32, DT_FLOAT16,
- DT_DOUBLE}))
- .OP_END_FACTORY_REG(DivNoNan)
-
- /**
- *@brief Reverses specific dimensions of a tensor. \n
-
- *@par Inputs:
- * One input: \n
- *x: A Tensor, Must be one of the following types:
- * int32, uint8, int16, int8, int64, int64, uint16, uint32, uint64,
- * and format can be [NCHW,NC1HWC0,NHWC,ND]
-
- *@par Outputs:
- *y: A Tensor. Has the same type and format as "x"
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Invert.
- */
- REG_OP(Invert)
- .INPUT(x, TensorType::IntegerDataType())
- .OUTPUT(y, TensorType::IntegerDataType())
- .OP_END_FACTORY_REG(Invert)
-
- /**
- *@brief Returns a tensor of the same shape and type with all elements set to one.
- *@par Inputs:
- *One input: \n
- *x: A Tensor. Must be one of the following types: float16, float32, int8, uint8,
- * int16, uint16, int32, int64, complex128, bool. \n
-
- *@par Outputs:
- *y: A Tensor of the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator OnesLike.
- */
- REG_OP(OnesLike)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT8,
- DT_UINT8, DT_INT16, DI_UINT16, DT_INT32,
- DT_INT64, DT_COMPLEX128, DT_BOOL}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT8,
- DT_UINT8, DT_INT16, DI_UINT16, DT_INT32,
- DT_INT64, DT_COMPLEX128, DT_BOOL}))
- .OP_END_FACTORY_REG(OnesLike)
-
- /**
- *@brief Computes the gradient for the inverse of "x" with regard its input. \n
-
- *@par Inputs:
- *@li input_y: A Tensor. Must be one of the following types: float, double,
- * complex64, complex128, half.
- *@li input_dy: A Tensor. Must be one of the following types: float, double,
- * complex64, complex128, half. \n
-
- *@par Outputs:
- *output_data: A Tensor. Must be one of the following types: float, double,
- * complex64, complex128, half. \n
-
- *@attention Constraints:
- * "input_dy" has the same shape and type as "input_y". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator reciprocal_grad.
- */
- REG_OP(ReciprocalGrad)
- .INPUT(y, TensorType::UnaryDataType())
- .INPUT(dy, TensorType::UnaryDataType())
- .OUTPUT(z, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(ReciprocalGrad)
-
- /**
- *@brief Returns the truth value of (x1 > x2) element-wise. \n
- *when input is int32 and (x2 - x1) > 2**31 or < -2**31
- *aicore accuracy is not guaranteed \n
-
- *@par Inputs:
- *@li x1: A Tensor of type float16, float32, double, int64, int32, int16, int8,
- * uint8, uint16, uint32, uint64.
- *@li x2: A Tensor of the same data type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor of type bool.
-
- *@attention Constraints:
- * Broadcasting is supported. \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Greater. \n
-
- */
- REG_OP(Greater)
- .INPUT(x1, TensorType::RealNumberType())
- .INPUT(x2, TensorType::RealNumberType())
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(Greater)
-
- /**
- *@brief Returns a tensor of the same type and shape as the input tensor with all elements set to zero. \n
-
- *@par Inputs:
- *x: A Tensor. Must be one of the following types:
- * float32, float64, int32, uint8, int16, int8,
- * complex64, int64, qint8, quint8, qint32, qint16, quint16, uint16,
- * complex128, float16, uint32, uint64, complex64, complex128. \n
-
- *@par Outputs:
- *y: A Tensor of the same data type as "x". \n
-
- *@attention Constraints:
- * The output has the same shape and type as the input. \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator zeros_like.
- */
- REG_OP(ZerosLike)
- .INPUT(x, TensorType::BasicType())
- .OUTPUT(y, TensorType::BasicType())
- .OP_END_FACTORY_REG(ZerosLike)
-
- /**
- *@brief Returns the truth value of NOT "x" element-wise. \n
-
- *@par Inputs:
- *x: A Tensor of type bool. \n
-
- *@par Outputs:
- *y: A Tensor of type bool. \n
-
- *@attention Constraints:
- * The input and output values are "1" or "0", corresponding to bool values "true" and "false". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator logical_not.
- */
- REG_OP(LogicalNot)
- .INPUT(x, TensorType({DT_BOOL}))
- .OUTPUT(y, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(LogicalNot)
-
- /**
- *@brief Computes inverse hyperbolic sine of x element-wise.
- * Given an input tensor, this function computes inverse hyperbolic sine for every element in the tensor. \n
-
- *
- *@par Inputs:
- * x: A tensor. Must be one of the following types: float16, float32, float64, complex64, complex128.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Asinh.
- *
- */
- REG_OP(Asinh)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Asinh)
-
- /**
- *@brief Computes gradients for Asinh operation. \n
-
- *
- *@par Inputs:
- *@li y: A tensor. Must be one of the following types: float16, float32.
- *@li dy: A tensor of the same type as "y"
- *
- *@par Outputs:
- * z: A tensor. Has the same type as "y".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AsinhGrad.
- *
- */
- REG_OP(AsinhGrad)
- .INPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OUTPUT(z, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OP_END_FACTORY_REG(AsinhGrad)
-
- /**
- *@brief Computes inverse hyperbolic tangent of x element-wise.\n
- * Given an input tensor, this function computes inverse hyperbolic tangent for every element in the tensor. \n Input range is [-1,1] and output range is [-inf, inf]. If input is -1, \n output will be -inf and if the input is 1, output will be inf.\n Values outside the range will have nan as output. \n
-
- *
- *@par Inputs:
- * x: A tensor. Must be one of the following types: float16, float32, float64, complex64, complex128.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Atanh.
- *
- */
- REG_OP(Atanh)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Atanh)
-
- /**
- *@brief Computes the trignometric inverse tangent of x element-wise.
- * The atan operation returns the inverse of tan, such that if y = tan(x) then, x = atan(y). \n
-
- *
- *@par Inputs:
- * x: A tensor. Must be one of the following types: float16, float32, float64, complex64, complex128.
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x". The output of atan will lie within the invertible range of tan, i.e (-pi/2, pi/2).
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Atan.
- *
- */
- REG_OP(Atan)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Atan)
-
- /**
- *@brief Computes gradients for Atan operation. \n
-
- *
- *@par Inputs:
- *@li y: A tensor of type float16 or float32.
- *@li dy: A tensor of the same type as "y"
- *
- *@par Outputs:
- * z: A tensor. Has the same type as "y".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AtanGrad.
- *
- */
- REG_OP(AtanGrad)
- .INPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(dy, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OUTPUT(z, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OP_END_FACTORY_REG(AtanGrad)
-
- /**
- *@brief Computes arctangent of x1/x2 element-wise, respecting signs of the arguments. \n
-
- *
- *@par Inputs:
- *@li x1: A tensor. Must be one of the following types: float16, float32, float64
- *@li x2: A tensor of the same type as "x1".
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x1".
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Atan2.
- *
- */
- REG_OP(Atan2)
- .INPUT(x1, TensorType::FloatingDataType())
- .INPUT(x2, TensorType::FloatingDataType())
- .OUTPUT(y, TensorType::FloatingDataType())
- .OP_END_FACTORY_REG(Atan2)
-
- /**
- *@brief Returns the truth value of abs(x1-x2) < tolerance element-wise. \n
-
- *
- *@par Inputs:
- *@li x1: A tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, complex64, int64, qint8, quint8, qint32, uint16, complex128, float16, uint32, uint64
- *@li x2: A tensor of the same type as "x1".
- *
- *@par Attributes:
- * tolerance: Defaults to "1e-05".
- *
- *@par Outputs:
- * y: A tensor of type bool.
- *
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator ApproximateEqual.
- *
- */
- REG_OP(ApproximateEqual)
- .INPUT(x1, TensorType::NumberType())
- .INPUT(x2, TensorType::NumberType())
- .OUTPUT(y, TensorType({DT_BOOL}))
- .ATTR(tolerance, Float, 1e-5)
- .OP_END_FACTORY_REG(ApproximateEqual)
-
- /**
- *@brief Returns the element-wise sum of a list of tensors.\n
- * AccumulateNV2 performs the same operation as AddN, but does not wait for all of its inputs
- to be ready before beginning to sum.\n This can save memory if inputs are ready at different times,
- since minimum temporary storage is proportional to the output size rather than the inputs size.
- Returns a Tensor of same shape and type as the elements of inputs. \n
-
- *
- *@par Inputs:
- *Dynamic inputs, including:
- * x: A tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, complex64, int64,
- qint8, quint8, qint32, uint16, complex128, float16, uint32, uint64. It's a dynamic input. \n
- *
- *@par Outputs:
- * y: A tensor. Has the same type as "x".
- *
- *@par Attributes:
- * N: the size of x.
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator AccumulateNV2.
- *
- */
- REG_OP(AccumulateNV2)
- .DYNAMIC_INPUT(x, TensorType::NumberType())
- .OUTPUT(y, TensorType::NumberType())
- .REQUIRED_ATTR(N, Int)
- .OP_END_FACTORY_REG(AccumulateNV2)
-
- /**
- *@brief Fake-quantizes the input Tensor, type float to output a Tensor of same type.
- * [min, max] define the clamping range for the "inputs" data.\n
- * the values of "x" are quantized into the quantization range ([0, 2^num_bits - 1] \n
- * when "narrow_range" is "false" or [1, 2^num_bits - 1] when it is "true") and \n
- * then de-quantized and output as float32 in [min; max] interval.\n
- * num_bits is the bit width of the quantization, between 2 and 16, inclusive. \n
- * Quantization is called fake since the output is still in floating point. \n
-
- *@par Inputs:
- *One input:
- *x: A Tensor of type float32. \n
-
- *@par Attributes:
- *@li min: An optional attribute. Defaults to "-6.0".
- *@li max: An optional attribute. Defaults to "6.0".
- *@li num_bits: An optional attribute. Defaults to "8".
- *@li narrow_range: An optional bool. Defaults to "false". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same shape and type of "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator FakeQuantWithMinMaxArgs.
- */
- REG_OP(FakeQuantWithMinMaxArgs)
- .INPUT(x, TensorType({DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT}))
- .ATTR(min, Float, -6.0)
- .ATTR(max, Float, 6.0)
- .ATTR(num_bits, Int, 8)
- .ATTR(narrow_range, Bool, false)
- .OP_END_FACTORY_REG(FakeQuantWithMinMaxArgs)
-
- /**
- *@brief Computes gradients for a FakeQuantWithMinMaxArgs operation. \n
-
- *@par Inputs:
- *Two inputs, including: \n
- *@li gradients: A Tensor of type float32. Backpropagated gradients above the FakeQuantWithMinMaxArgs operation.
- *@li x: A Tensor of type float32. Has the same type and format as "gradients".\n
- * This is the input Tensor of the FakeQuantWithMinMaxArgs operator.\n
-
- *@par Attributes:
- *@li min: An optional attribute. Defaults to "-6.0".
- *@li max: An optional attribute. Defaults to "6.0".
- *@li num_bits: An optional attribute. Defaults to "8".
- *@li narrow_range: An optional bool. Defaults to "False". \n
-
- *@par Outputs:
- *y: A Tensor of type float32. \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator FakeQuantWithMinMaxArgsGradient.
- */
- REG_OP(FakeQuantWithMinMaxArgsGradient)
- .INPUT(gradients, TensorType({DT_FLOAT}))
- .INPUT(x, TensorType({DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT}))
- .ATTR(min, Float, -6.0)
- .ATTR(max, Float, 6.0)
- .ATTR(num_bits, Int, 8)
- .ATTR(narrow_range, Bool, false)
- .OP_END_FACTORY_REG(FakeQuantWithMinMaxArgsGradient)
-
- /**
- *@brief Fake-quantize the 'inputs' tensor of type float via global float scalars. \n
-
- *@par Inputs:
- *Three inputs, including:
- *@li x: A Tensor of type float32.
- *@li min: A Tensor of type float32. Has the same type and format as "x".
- *@li max: A Tensor of type float32. Has the same type and format as "x".\n
- *[min; max] define the clamping range for the inputs data
-
- *@par Attributes:
- *@li num_bits: An optional attribute. Defaults to "8".
- *@li narrow_range: An optional bool. Defaults to "False". \n
-
- *@par Outputs:
- *y: A Tensor of type float32. \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator FakeQuantWithMinMaxVars.
- */
- REG_OP(FakeQuantWithMinMaxVars)
- .INPUT(x, TensorType({DT_FLOAT}))
- .INPUT(min, TensorType({DT_FLOAT}))
- .INPUT(max, TensorType({DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT}))
- .ATTR(num_bits, Int, 8)
- .ATTR(narrow_range, Bool, false)
- .OP_END_FACTORY_REG(FakeQuantWithMinMaxVars)
-
- /**
- *@brief Computes gradients for a FakeQuantWithMinMaxVars operation. \n
-
- *@par Inputs:
- *Four inputs, including:
- *@li gradients: A Tensor of type float32.
- *@li x: A Tensor of type float32.
- *@li min: A Tensor of type float32.
- *@li max: A Tensor of type float32. \n
-
- *@par Attributes:
- *@li num_bits: An integer specifying the quantization bit width. Defaults to "8".
- *@li narrow_range: A Boolean specifying whether to use a narrow range for quantization. Defaults to "False". \n
-
- *@par Outputs:
- *@li backprops_wrt_x: A Tensor. Has the same type as input "x".
- *@li backprops_wrt_min: A Tensor. Has the same type as input "min".
- *@li backprops_wrt_max: A Tensor. Has the same type as input "max". \n
-
- *@attention Constraints:
- *@li "gradients" has the same shape as "x".
- *@li "min" and "max" are scalars.
- *@li "num_bits" is between 2 and 16
-
- *@see Region()
-
- *@par Third-party framework compatibility
- * Compatible with the operator FakeQuantWithMinMaxVarsGradient.
- */
- REG_OP(FakeQuantWithMinMaxVarsGradient)
- .INPUT(gradients, TensorType({DT_FLOAT}))
- .INPUT(x, TensorType({DT_FLOAT}))
- .INPUT(min, TensorType({DT_FLOAT}))
- .INPUT(max, TensorType({DT_FLOAT}))
- .OUTPUT(backprops_wrt_x, TensorType({DT_FLOAT}))
- .OUTPUT(backprops_wrt_min, TensorType({DT_FLOAT}))
- .OUTPUT(backprops_wrt_max, TensorType({DT_FLOAT}))
- .ATTR(num_bits, Int, 8)
- .ATTR(narrow_range, Bool, false)
- .OP_END_FACTORY_REG(FakeQuantWithMinMaxVarsGradient)
-
- /**
- *@brief Fake-quantizes the "inputs" tensor of type float
- via per-channel floats min and max of shape [d] to "outputs" \n
- tensor of same shape as inputs
-
- *@par Inputs:
- *Three inputs, including:
- *@li x: A Tensor of type float32.
- *@li min: A Tensor of type float32.
- *@li max: A Tensor of type float32. \n
-
- *@par Attributes:
- *@li num_bits: An integer specifying the quantization bit width. Defaults to "8".
- *@li narrow_range: A Boolean specifying whether to use a narrow range for quantization. Defaults to "False". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as input "x".
-
-
- *@attention Constraints:
- *@li "min" and "max" have one-dimensional shapes.
- *@li "min" has the same last dimension size as "x". "max" has the same last dimension size as "x".
- *@li "num_bits" is between 2 and 16
-
- *@see Region()
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator FakeQuantWithMinMaxVarsPerChannel.
- */
- REG_OP(FakeQuantWithMinMaxVarsPerChannel)
- .INPUT(x, TensorType({DT_FLOAT}))
- .INPUT(min, TensorType({DT_FLOAT}))
- .INPUT(max, TensorType({DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT}))
- .ATTR(num_bits, Int, 8)
- .ATTR(narrow_range, Bool, false)
- .OP_END_FACTORY_REG(FakeQuantWithMinMaxVarsPerChannel)
-
- /**
- *@brief Computes gradients for a FakeQuantWithMinMaxVarsPerChannel operation. \n
-
- *@par Inputs:
- *Four inputs, including:
- *@li gradients: A Tensor of type float32.
- *@li x: A Tensor of type float32.
- *@li min: A Tensor of type float32.
- *@li max: A Tensor of type float32. \n
-
- *@par Attributes:
- *@li num_bits: An integer specifying the quantization bit width. Defaults to "8".
- *@li narrow_range: A Boolean specifying whether to use a narrow range for quantization. Defaults to "False". \n
-
- *@par Outputs:
- *@li backprops_wrt_x: A Tensor. Has the same type as input "x".
- *@li backprops_wrt_min: A Tensor. Has the same type as input "min".
- *@li backprops_wrt_max: A Tensor. Has the same type as input "max". \n
-
- *@attention Constraints:
- *@li "gradients" has the same shape as "x".
- *@li "min" and "max" have one-dimensional shapes.
- *@li "min" has the same last dimension size as "x". "max" has the same last dimension size as "x". "gradients" has the same last dimension size as "x".
- *@li "num_bits" is between 2 and 16
-
- *@see Region()
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator FakeQuantWithMinMaxVarsPerChannelGradient.
- */
- REG_OP(FakeQuantWithMinMaxVarsPerChannelGradient)
- .INPUT(gradients, TensorType({DT_FLOAT}))
- .INPUT(x, TensorType({DT_FLOAT}))
- .INPUT(min, TensorType({DT_FLOAT}))
- .INPUT(max, TensorType({DT_FLOAT}))
- .OUTPUT(backprops_wrt_x, TensorType({DT_FLOAT}))
- .OUTPUT(backprops_wrt_min, TensorType({DT_FLOAT}))
- .OUTPUT(backprops_wrt_max, TensorType({DT_FLOAT}))
- .ATTR(num_bits, Int, 8)
- .ATTR(narrow_range, Bool, false)
- .OP_END_FACTORY_REG(FakeQuantWithMinMaxVarsPerChannelGradient)
-
- /**
- *@brief Element-wise computes the bitwise AND of "x1" and "x2". \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: int8, int16,
- * int32, int64, uint8, uint16, uint32, uint64. Broadcasting is supported.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator BitwiseAnd.
- */
- REG_OP(BitwiseAnd)
- .INPUT(x1, TensorType::IntegerDataType())
- .INPUT(x2, TensorType::IntegerDataType())
- .OUTPUT(y, TensorType::IntegerDataType())
- .OP_END_FACTORY_REG(BitwiseAnd)
-
- /**
- *@brief Element-wise computes the bitwise OR of "x1" and "x2". \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: int8, int16,
- * int32, int64, uint8, uint16, uint32, uint64. Broadcasting is supported.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator BitwiseOr.
- */
- REG_OP(BitwiseOr)
- .INPUT(x1, TensorType::IntegerDataType())
- .INPUT(x2, TensorType::IntegerDataType())
- .OUTPUT(y, TensorType::IntegerDataType())
- .OP_END_FACTORY_REG(BitwiseOr)
-
- /**
- *@brief Elementwise computes the bitwise XOR of "x1" and "x2". \n
-
- *@par Inputs:
- *Two inputs, including:
- *@li x1: A Tensor. Must be one of the following types: int8, int16, int32, int64, uint8, uint16, uint32, uint64.
- * The format is NC1HWC0 or ND. Broadcasting is supported.
- *@li x2: A Tensor. Has the same type and format as "x1". \n
-
- *@par Outputs:
- *y: Output result. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator BitwiseXor.
- */
- REG_OP(BitwiseXor)
- .INPUT(x1, TensorType::IntegerDataType())
- .INPUT(x2, TensorType::IntegerDataType())
- .OUTPUT(y, TensorType::IntegerDataType())
- .OP_END_FACTORY_REG(BitwiseXor)
-
- /**
- *@brief Returns element-wise smallest integer not less than "x". \n
-
- *@par Inputs:
- * x: A Tensor of type float16 or float32 or float64. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x".
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Ceil.
- */
- REG_OP(Ceil)
- .INPUT(x, TensorType::FloatingDataType())
- .OUTPUT(y, TensorType::FloatingDataType())
- .OP_END_FACTORY_REG(Ceil)
-
- /**
- *@brief Returns element-wise largest integer not greater than "x". \n
-
- *@par Inputs:
- *x: A Tensor of type float16, float32 or double. \n
-
- *@par Outputs:
- *y: A Tensor of the same type as "x". \n
-
- *@par Third-party framework compatibility:
- * Compatible with TensorFlow operator Floor.
- */
- REG_OP(Floor)
- .INPUT(x, TensorType::FloatingDataType())
- .OUTPUT(y, TensorType::FloatingDataType())
- .OP_END_FACTORY_REG(Floor)
-
- /**
- *@brief Divides "x1/x2" element-wise, rounding toward the
- * most negative integer. \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32, int32, int64, int8,
- * uint8, int16, uint16, double, complex64, complex128.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator FloorDiv.
- */
- REG_OP(FloorDiv)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8,
- DT_INT64, DT_INT16, DT_UINT16, DT_DOUBLE,
- DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8,
- DT_INT64, DT_INT16,DT_UINT16, DT_DOUBLE,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8,
- DT_INT64, DT_INT16,DT_UINT16, DT_DOUBLE,
- DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(FloorDiv)
-
- /**
- *@brief Returns element-wise remainder of division. Consistent with: floor(x1/x2) * x2 + mod(x1, x2) = x1. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x1: A Tensor. Must be one of the following types:
- * int32, int64, float, float16, double
- *@li x2: A Tensor. Must have the same type as "x1".
- *
- *@par Outputs:
- *y: Result remainder.
-
- *@attention Constraints:
- *@li x2: The input data does not support 0
- *@li When NUM exceeds 2048 , the accuracy of operator cannot guarantee the
- *requirement of double thousandths in the mini form
- *@li Due to different architectures, the calculation results of this operator
- *on NPU and CPU may be inconsistent
- *@li If shape is expressed as (D1,D2... ,Dn), then D1*D2... *DN<=1000000,n<=8
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator FloorMod.
- */
- REG_OP(FloorMod)
- .INPUT(x1, TensorType({DT_INT32, DT_INT64, DT_FLOAT, DT_FLOAT16,
- DT_DOUBLE}))
- .INPUT(x2, TensorType({DT_INT32, DT_INT64, DT_FLOAT, DT_FLOAT16,
- DT_DOUBLE}))
- .OUTPUT(y, TensorType({DT_INT32, DT_INT64, DT_FLOAT, DT_FLOAT16,
- DT_DOUBLE}))
- .OP_END_FACTORY_REG(FloorMod)
-
- /**
- *@brief Computes the power of "x1" to "x2". \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types:
- * float16, float32, int32, int64, int8, uint8, double, complex64, complex128.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator Pow.
- */
- REG_OP(Pow)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT64, DT_INT8,
- DT_UINT8, DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT64, DT_INT8,
- DT_UINT8, DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT64, DT_INT8,
- DT_UINT8, DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128}))
- .OP_END_FACTORY_REG(Pow)
-
- /**
- *@brief Return element-wise integer closest to x. \n
-
- *@par Inputs:
- *One input, include:
- *x: A mutable Tensor. Must be one of the following types:
- * float16, float32, double. \n
-
- *@par Outputs:
- *y: A mutable Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Rint.
- */
- REG_OP(Rint)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE}))
- .OP_END_FACTORY_REG(Rint)
-
- /**
- *@brief Rounds the values of a tensor to the nearest integer, element-wise.
- * Rounds half to even. \n
-
- *@par Inputs:
- *Inputs including:
- *x: A required ND Tensor of type float16, float, int64, double, complex64,
- * complex128 or int32.
- *@par Outputs:
- *y: A required ND Tensor. Has the same data type and shape as "x".
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator Round.
- */
- REG_OP(Round)
- .INPUT(x, TensorType(DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT64,
- DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128))
- .OUTPUT(y, TensorType(DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT64,
- DT_DOUBLE, DT_COMPLEX64, DT_COMPLEX128))
- .OP_END_FACTORY_REG(Round)
-
- /**
- *@brief: Computes sine of "x" element-wise. \n
-
- *@par Inputs:
- *One input:
- *x: An ND Tensor. Must be one of the following types: float16, float32, double,
- * complex64, complex128, int32, int64
-
- *@par Outputs:
- *y: An ND Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator Sin.
- */
- REG_OP(Sin)
- .INPUT(x, TensorType::UnaryDataType())
- .OUTPUT(y, TensorType::UnaryDataType())
- .OP_END_FACTORY_REG(Sin)
-
- /**
- *@brief: Computes tan of "x" element-wise. \n
-
- *@par Inputs:
- *One input:
- *x: A Tensor. Must be one of the following types: float16, float32, double, complex64, complex128, int32, int64
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator Tan.
- */
- REG_OP(Tan)
- .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128, DT_INT32, DT_INT64}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_DOUBLE, DT_COMPLEX64,
- DT_COMPLEX128, DT_INT32, DT_INT64}))
- .OP_END_FACTORY_REG(Tan)
-
- /**
- *@brief Returns element-wise remainder of division. \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32,
- * double, int32, int64.
- * @li x2: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x1". \n
-
- *@attention Constraints:
- *@li x2: The input data does not support 0
- *@li When NUM exceeds 2048 , the accuracy of operator cannot guarantee the
- *requirement of double thousandths in the mini form
- *@li Due to different architectures, the calculation results of this operator
- *on NPU and CPU may be inconsistent
- *@li If shape is expressed as (D1,D2... ,Dn), then D1*D2... *DN<=1000000,n<=8
-
- *@par Third-party framework compatibility
- *@li Compatible with the TensorFlow operator TruncateMod.
- */
- REG_OP(TruncateMod)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT64,
- DT_INT32}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT64,
- DT_INT32}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE, DT_INT64,
- DT_INT32}))
- .OP_END_FACTORY_REG(TruncateMod)
-
- /**
- *@brief Adds 'bias' to 'x'. \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x: A Tensor of type NumberType. Must be one of the following types: float32, float64, int32, uint8, int16,
- *int8, complex64, int64, qint8, quint8, qint32, bfloat16, uint16, complex128, float16, uint32, uint64.
- * @li bias: A 1D Tensor with size the C dimension of value. \n
-
- *@par Attributes:
- *data_format: An optional string. Defaults to "NHWC". \n
-
- *@par Outputs:
- *y: A Tensor with same type as "x". \n
-
- *@par Third-party framework compatibility
- *Compatible with the TensorFlow operator BiasAdd.
- */
- REG_OP(BiasAdd)
- .INPUT(x, TensorType::NumberType())
- .INPUT(bias, TensorType::NumberType())
- .OUTPUT(y, TensorType::NumberType())
- .ATTR(data_format, String, "NHWC")
- .OP_END_FACTORY_REG(BiasAdd)
-
- /**
- *@brief Returns the index with the smallest value across dimensions of a tensor. \n
-
- *@par Inputs:
- *Two inputs, including:
- *@li x: A Tensor. Must be one of the following types: float32, float64, int32, uint8, int16, int8, complex64, int64, qint8, quint8, qint32, bfloat16, uint16, complex128, float16, uint32, uint64.
- *format is ND.
- *@li dimension: A Tensor. Must be one of the following types: int32, int64. Must be in the range [-rank(input x), rank(input x)]. Describes which dimension of the input Tensor to reduce across.
- * The format is ND.
- *@par Attributes:
- *dtype: The output type, either "int32" or "int64". Defaults to "int64". \n
-
- *@par Outputs:
- *y: A Tensor of type "dtype". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator ArgMin.
- */
- REG_OP(ArgMin)
- .INPUT(x, TensorType::NumberType())
- .INPUT(dimension, TensorType::IndexNumberType())
- .OUTPUT(y, TensorType({DT_INT32, DT_INT64}))
- .ATTR(dtype, Type, DT_INT64)
- .OP_END_FACTORY_REG(ArgMin)
-
- /**
- *@brief Returns the index with the smallest value across dimensions of a tensor. \n
-
- *@par Inputs:
- *One input:
-
- *x: A Tensor of type float16 or float32 in ND format. \n
-
- *@par Attributes:
- *@li dimension: The dimension of the input Tensor to reduce across.
- *@li dtype: An optional attribute, specifying the output data type. Must be "int32". Defaults to "int64". \n
-
- *@par Outputs:
- *y: A Tensor of type dtype. \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator ArgMin.
- *
- * @par Restrictions:
- * Warning: THIS FUNCTION IS DEPRECATED. Please use ArgMin instead.
- */
- REG_OP(ArgMinD)
- .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16}))
- .OUTPUT(y, TensorType({DT_INT32}))
- .REQUIRED_ATTR(dimension, Int)
- .ATTR(dtype, Type, DT_INT64)
- .OP_END_FACTORY_REG(ArgMinD)
-
- /**
- *@brief Returns the index with the largest value across axes of a tensor. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x: A multi-dimensional Tensor of type float16, float32, or int16.
- *@li dimension: A Scalar of type int32, specifying the index with the largest value. \n
-
- *@par Attributes:
- *dtype: The output type, either "int32" or "int64". Defaults to "int64". \n
-
- *@par Outputs:
- *y: A multi-dimensional Tensor of type int32 or int64, specifying the index with the largest value. The dimension is one less than that of "x". \n
-
- *@attention Constraints:
- *@li x: If there are multiple maximum values, the index of the first maximum value is used.
- *@li The value range of "dimension" is [-dims, dims - 1]. "dims" is the dimension length of "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator ArgMax.
- */
- REG_OP(ArgMaxV2)
- .INPUT(x, TensorType::NumberType())
- .INPUT(dimension, TensorType::IndexNumberType())
- .OUTPUT(y, TensorType({DT_INT32, DT_INT64}))
- .ATTR(dtype, Type, DT_INT64)
- .OP_END_FACTORY_REG(ArgMaxV2)
-
- /**
- *@brief Returns the index with the largest value across axes of a tensor. \n
-
- *@par Inputs:
- * One input, including:
- *x: A multi-dimensional Tensor of type float16, float32. \n
-
- *@par Attributes:
- *@li dimension: An integer of type int32, specifying the axis information of the index with the maximum value.
- *@li dtype: The output type, either "int32" or "int64". Defaults to "int64". \n
-
- *@par Outputs:
- *y: A multi-dimensional Tensor of type int32, specifying the index with the largest value. The dimension is one less than that of "x". \n
-
- *@attention Constraints:
- *@li x: If there are multiple maximum values, the index of the first maximum value is used.
- *@li The value range of "dimension" is [-dims, dims - 1]. "dims" is the dimension length of "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with TensorFlow operator ArgMax.
- *
- * @par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(ArgMaxD)
- .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16}))
- .OUTPUT(y, TensorType({DT_INT32}))
- .REQUIRED_ATTR(dimension, Int)
- .ATTR(dtype, Type, DT_INT64)
- .OP_END_FACTORY_REG(ArgMaxD)
-
- /**
- *@brief Returns the maximum value of all elements in the input in the given
- * dimension. \n
-
- *@par Inputs:
- *One input: \n
- *x: A multi-dimensional Tensor of type float16 or float32. \n
-
- *@par Attributes:
- *@li dimension: An integer of type int32, specifying the axis information of
- * the index with the maximum value.
- *@li keep_dims: A bool, specifying whether to keep dimensions for the output
- * Tensor. Defaults to "false". \n
-
- *@par Outputs:
- *@li indice: A multi-dimensional Tensor of type int32, specifying the index.
- * (If "keep_dims" is set to "false", the output dimensions are reduced by
- * "dimension" compared with that of "x". Otherwise, the output has one fewer
- * dimension than "x".)
- *@li values: A Tensor, specifying the maximum value. Has the same dimensions
- * as "indice" and the same type as "x". \n
-
- *@attention Constraints:
- *@li If there are multiple maximum values, the index of the first maximum
- * value is used.
- *@li The value range of "dimension" is [-dims, dims - 1]. "dims" is the
- * dimension length of "x". \n
-
- *@par Third-party framework compatibility
- * Compatible with the two output scenarios of PyTorch operator Max (the output
- * sequence is opposite to that of PyTorch).
- */
- REG_OP(ArgMaxWithValue)
- .INPUT(x, TensorType({DT_FLOAT,DT_FLOAT16}))
- .OUTPUT(indice,TensorType({DT_INT32}))
- .OUTPUT(values, TensorType({DT_FLOAT,DT_FLOAT16}))
- .REQUIRED_ATTR(dimension, Int)
- .ATTR(keep_dims, Bool, false)
- .OP_END_FACTORY_REG(ArgMaxWithValue)
-
- /**
- *@par Inputs:
- *One input: \n
- *x: A multi-dimensional Tensor of type float16 or float32. \n
-
- *@par Attributes:
- *@li dimension: An integer of type int32, specifying the axis information of
- * the index with the maximum value.
- *@li keep_dims: A bool, specifying whether to keep dimensions for the output
- * Tensor. Defaults to "false". \n
-
- *@par Outputs:
- *@li indice: A multi-dimensional Tensor of type int32, specifying the index.
- * (If "keep_dims" is set to "false", the output dimensions are reduced by
- * "dimension" compared with that of "x". Otherwise, the output has one fewer
- * dimension than "x".)
- *@li values: A Tensor, specifying the minimum value. Has the same dimensions
- * as "indice" and the same type as "x". \n
-
- *@attention Constraints:
- *@li If there are multiple minimum values, the index of the first minimum
- * value is used.
- *@li The value range of "dimension" is [-dims, dims - 1]. "dims" is the
- * dimension length of "x".
- *@li Performing the ArgMinWithValue operation on the last axis of float32 data
- * is not supported on a mini platform. \n
-
- *@par Third-party framework compatibility
- * Compatible with the two output scenarios of PyTorch operator Min (the output
- * sequence is opposite to that of PyTorch).
- */
- REG_OP(ArgMinWithValue)
- .INPUT(x, TensorType({DT_FLOAT,DT_FLOAT16}))
- .OUTPUT(indice,TensorType({DT_INT32}))
- .OUTPUT(values, TensorType({DT_FLOAT,DT_FLOAT16}))
- .REQUIRED_ATTR(dimension, Int)
- .ATTR(keep_dims, Bool, false)
- .OP_END_FACTORY_REG(ArgMinWithValue)
-
- /**
- *@brief Compute elementwise modes, such as 0: PRODUCT, 1: SUM, 2: MAX
-
- *@par Inputs:
- *One input: \n
- *x: the list of input data, the type of element in Tensor should be same.
- * the max size of x is 32.
- * should met one of the following types: float16, float32. It's a dynamic input. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type and format as "x". \n
-
- *@par Attributes:
- *@li N: A required attribute. the number of input x, max size is 32. Type is int.
- *@li model: An optional attribute. Type is int. Defaults to "1".
- * "0": product, "1": sum, "2": max.
- *@li coeff: A required attribute. Must met all of following rules:
- * size of "coeff" must be equal to len("x") or is null.
- * the absolute value of "coeff" must less than or equal to 1.
- */
- REG_OP(Eltwise)
- .DYNAMIC_INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .REQUIRED_ATTR(N, Int)
- .ATTR(mode, Int, 1)
- .ATTR(coeff, ListFloat, {})
- .OP_END_FACTORY_REG(Eltwise)
-
- /**
- *@brief Computes the inverse error function of each element of input. \n
-
- *@par Inputs:
- *One inputs, including:
- * @li input_x: A tensor. Must be one of the following types:
- * float16, float32. \n
-
- *@par Outputs:
- *y: A Tensor with the same type and shape of input_x's. \n
-
- *@par Third-party framework compatibility
- *Compatible with the Pytorch operator Erfinv. \n
- */
- REG_OP(Erfinv)
- .INPUT(input_x, TensorType({DT_FLOAT, DT_FLOAT16}))
- .OUTPUT(output_y, TensorType({DT_FLOAT, DT_FLOAT16}))
- .OP_END_FACTORY_REG(Erfinv)
-
- /**
- *@brief Computes element-wise population count. \n
-
- *@par Inputs:
- *x: A Tensor of type TensorType::IntegerDataType(). \n
-
- *@par Outputs:
- *y: A Tensor of type uint8. \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator PopulationCount.
- */
- REG_OP(PopulationCount)
- .INPUT(x, TensorType::IntegerDataType())
- .OUTPUT(y, TensorType({DT_UINT8}))
- .OP_END_FACTORY_REG(PopulationCount)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Thirteen inputs, including:
- * @li input_mul3: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul2: A Tensor. Must be one of the following types: float16, float32.
- * @li input_realdiv1: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul1: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul0: A Tensor. Must be one of the following types: float16, float32.
- * @li input_realdiv0: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul4: A Tensor. Must be one of the following types: float16, float32.
- * @li mul0_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul1_sub: A Tensor. Must be one of the following types: float16, float32.
- * @li mul2_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul3_sub1: A Tensor. Must be one of the following types: float16, float32.
- * @li mul4_x: A Tensor. Must be one of the following types: float16, float32.
- * @li add2_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *Four outputs, including:
- * @li y1: A Tensor. Must be one of the following types: float16, float32.
- * @li y2: A Tensor. Must be one of the following types: float16, float32.
- * @li y3: A Tensor. Must be one of the following types: float16, float32.
- * @li y4: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(LambNextMVWithDecay)
- .INPUT(input_mul3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_realdiv1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_realdiv0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul0_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul1_sub, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul2_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul3_sub1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul4_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(add2_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(LambNextMVWithDecay)
-
- /**
- *@brief Confuse real_div, rsqrt, sqrt, maximum, minimum, sub and add. \n
-
- *@par Inputs:
- *Thirteen inputs, including:
- * @li input_mul3: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul2: A Tensor of the same type as "input1".
- * @li input_realdiv1: A Tensor of the same type as "input1".
- * @li input_mul1: A Tensor of the same type as "input1".
- * @li input_mul0: A Tensor of the same type as "input1".
- * @li input_realdiv0: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul4: A Tensor of the same type as "input1".
- * @li mul0_x: A Tensor of the same type as "input1".
- * @li mul1_sub: A Tensor of the same type as "input1".
- * @li mul2_x: A Tensor of the same type as "input1".
- * @li mul3_sub1: A Tensor. Must be one of the following types: float16, float32.
- * @li mul4_x: A Tensor of the same type as "input1".
- * @li add2_y: A Tensor of the same type as "input1". \n
-
- *@par Outputs:
- *Four outputs, including:
- *@li y1: A Tensor. Has the same type as "input_mul3".
- *@li y2: A Tensor. Has the same type as "input_mul3".
- *@li y3: A Tensor. Has the same type as "input_mul3".
- *@li y4: A Tensor. Has the same type as "input_mul3".
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(LambNextMV)
- .INPUT(input_mul3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_realdiv1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_realdiv0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul0_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul1_sub, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul2_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul3_sub1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul4_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(add2_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(LambNextMV)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Six inputs, including:
- * @li input_square: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul2: A Tensor. Must be one of the following types: float16, float32.
- * @li mul2_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul3_x: A Tensor. Must be one of the following types: float16, float32.
- * @li truediv1_recip: A Tensor. Must be one of the following types: float16, float32.
- * @li add2_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *Two outputs, including:
- * @li y1: A Tensor of the same type as "input_square".
- * @li y2: A Tensor of the same type as "input_square". \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(LambNextRight)
- .INPUT(input_square, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul2_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul3_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(truediv1_recip, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(add2_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(LambNextRight)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Six inputs, including:
- * @li input_greater1: A Tensor. Must be one of the following types: float16, float32.
- * @li input_greater_realdiv: A Tensor. Must be one of the following types: float16, float32.
- * @li input_realdiv: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul0: A Tensor. Must be one of the following types: float16, float32.
- * @li input_mul1: A Tensor. Must be one of the following types: float16, float32.
- * @li input_sub: A Tensor. Must be one of the following types: float16, float32.
- * @li greater_y: A Tensor. Must be one of the following types: float16, float32.
- * @li select_e: A Tensor. Must be one of the following types: float16, float32.
- * @li minimum_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *y: A Tensor of the same type as "input_greater1". \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(LambUpdateWithLr)
- .INPUT(input_greater1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_greater_realdiv, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_realdiv, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_mul1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_sub, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(greater_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(select_e, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(minimum_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(LambUpdateWithLr)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Seven inputs, including:
- * @li x1: A Tensor. Must be one of the following types: float16, float32.
- * @li x2: A Tensor. Must be one of the following types: float16, float32.
- * @li x3: A Tensor. Must be one of the following types: float16, float32.
- * @li x4: A Tensor. Must be one of the following types: float16, float32.
- * @li x5: A Tensor. Must be one of the following types: float16, float32.
- * @li greater_y: A Tensor. Must be one of the following types: float16, float32.
- * @li select_e: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *y: A Tensor of the same type as input. \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(LambUpdateWithLrV2)
- .INPUT(x1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(x2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(x3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(x4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(x5, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(greater_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(select_e, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(LambUpdateWithLrV2)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Eleven inputs, including:
- * @li input0: A Tensor. Must be one of the following types: float16, float32.
- * @li input1: A Tensor. Must be one of the following types: float16, float32.
- * @li input2: A Tensor. Must be one of the following types: float16, float32.
- * @li input3: A Tensor. Must be one of the following types: float16, float32.
- * @li input4: A Tensor. Must be one of the following types: float16, float32.
- * @li mul0_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul1_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul2_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul3_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul4_x: A Tensor. Must be one of the following types: float16, float32.
- * @li add2_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *Three outputs, including:
- * @li output0: A Tensor. Must be one of the following types: float16, float32.
- * @li output1: A Tensor. Must be one of the following types: float16, float32.
- * @li output2: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(AdamApplyOneWithDecay)
- .INPUT(input0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul0_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul1_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul2_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul3_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul4_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(add2_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(AdamApplyOneWithDecay)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Ten inputs, including:
- * @li input0: A Tensor. Must be one of the following types: float16, float32.
- * @li input1: A Tensor. Must be one of the following types: float16, float32.
- * @li input2: A Tensor. Must be one of the following types: float16, float32.
- * @li input3: A Tensor. Must be one of the following types: float16, float32.
- * @li input4: A Tensor. Must be one of the following types: float16, float32.
- * @li mul0_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul1_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul2_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul3_x: A Tensor. Must be one of the following types: float16, float32.
- * @li add2_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *Three outputs, including:
- * @li output0: A Tensor. Must be one of the following types: float16, float32.
- * @li output1: A Tensor. Must be one of the following types: float16, float32.
- * @li output2: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(AdamApplyOne)
- .INPUT(input0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul0_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul1_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul2_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul3_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(add2_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(AdamApplyOne)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Eleven inputs, including:
- * @li input0: A Tensor. Must be one of the following types: float16, float32.
- * @li input1: A Tensor. Must be one of the following types: float16, float32.
- * @li input2: A Tensor. Must be one of the following types: float16, float32.
- * @li input3: A Tensor. Must be one of the following types: float16, float32.
- * @li input4: A Tensor. Must be one of the following types: float16, float32.
- * @li mul0_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul1_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul2_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul3_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul4_x: A Tensor. Must be one of the following types: float16, float32.
- * @li add2_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *Three outputs, including:
- * @li output0: A Tensor. Must be one of the following types: float16, float32.
- * @li output1: A Tensor. Must be one of the following types: float16, float32.
- * @li output2: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(AdamApplyOneWithDecayAssign)
- .INPUT(input0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul0_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul1_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul2_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul3_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul4_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(add2_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(AdamApplyOneWithDecayAssign)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Ten inputs, including:
- * @li input0: A Tensor. Must be one of the following types: float16, float32.
- * @li input1: A Tensor. Must be one of the following types: float16, float32.
- * @li input2: A Tensor. Must be one of the following types: float16, float32.
- * @li input3: A Tensor. Must be one of the following types: float16, float32.
- * @li input4: A Tensor. Must be one of the following types: float16, float32.
- * @li mul0_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul1_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul2_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul3_x: A Tensor. Must be one of the following types: float16, float32.
- * @li add2_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *Three outputs, including:
- * @li output0: A Tensor. Must be one of the following types: float16, float32.
- * @li output1: A Tensor. Must be one of the following types: float16, float32.
- * @li output2: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(AdamApplyOneAssign)
- .INPUT(input0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input4, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul0_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul1_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul2_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul3_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(add2_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(AdamApplyOneAssign)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Ten inputs, including:
- * @li input0: A Tensor. Must be one of the following types: float16, float32.
- * @li input1: A Tensor. Must be one of the following types: float16, float32.
- * @li input2: A Tensor. Must be one of the following types: float16, float32.
- * @li input3: A Tensor. Must be one of the following types: float16, float32.
- * @li input4: A Tensor. Must be one of the following types: float16, float32.
- * @li mul0_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul1_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul2_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul3_x: A Tensor. Must be one of the following types: float16, float32.
- * @li steps: A Tensor. Must be one of the following types: float16, float32.
- * @li do_use_weight: A Tensor. Must be one of the following types: float16, float32.
- * @li weight_decay_rate: A Tensor. Must be one of the following types: float16, float32.
- * @li add2_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *Three outputs, including:
- * @li output0: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(LambApplyOptimizerAssign)
- .INPUT(grad, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(inputv, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(inputm, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul0_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul1_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul2_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(mul3_x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(add2_y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(steps, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(do_use_weight, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(weight_decay_rate, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(inputv, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(inputm, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(LambApplyOptimizerAssign)
-
- /**
- *@brief A fusion operator for bert lamb. \n
-
- *@par Inputs:
- *Ten inputs, including:
- * @li input0: A Tensor. Must be one of the following types: float16, float32.
- * @li input1: A Tensor. Must be one of the following types: float16, float32.
- * @li input2: A Tensor. Must be one of the following types: float16, float32.
- * @li input3: A Tensor. Must be one of the following types: float16, float32.
- * @li input4: A Tensor. Must be one of the following types: float16, float32.
- * @li mul0_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul1_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul2_x: A Tensor. Must be one of the following types: float16, float32.
- * @li mul3_x: A Tensor. Must be one of the following types: float16, float32.
- * @li steps: A Tensor. Must be one of the following types: float16, float32.
- * @li do_use_weight: A Tensor. Must be one of the following types: float16, float32.
- * @li weight_decay_rate: A Tensor. Must be one of the following types: float16, float32.
- * @li add2_y: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *No outputs
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(LambApplyWeightAssign)
- .INPUT(input0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input3, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input_param, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(input_param, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(LambApplyWeightAssign)
-
- /**
- *@brief Confuse select, maximum, greater and sqrt. \n
-
- *@par Inputs:
- *Four inputs, including:
- * @li x: A Tensor. Must be one of the following types: float16, float32.
- * @li greater_zeros: A Tensor. Must be one of the following types: float16, float32.
- * @li select_ones: A Tensor. Must be one of the following types: float16, float32.
- * @li maximum_ones: A Tensor. Must be one of the following types: float16, float32. \n
-
- *@par Outputs:
- *y: A Tensor of the same type as "x". \n
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(ClipByNormNoDivSum)
- .INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(greater_zeros, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(select_ones, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(maximum_ones, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OP_END_FACTORY_REG(ClipByNormNoDivSum)
-
- /**
- *@brief Confuse reducesumd and square. \n
-
- *@par Inputs:
- *x: A Tensor of type float16, float32. \n
-
- *@par Attributes:
- * Two attributes, including: \n
- *@li axis: A optional listint, specifies the dimensions to reduce.
- *@li keep_dims: A bool, specifying whether to keep dimensions for the output Tensor. Defaults to "false". \n
-
- *@par Outputs:
- *Two outputs, including: \n
- *@li y1: A Tensor. Has the same type as "x".
- *@li y2: A Tensor. Has the same type as "x".
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(SquareSumV2)
- .INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .REQUIRED_ATTR(axis, ListInt)
- .ATTR(keep_dims, Bool, false)
- .OP_END_FACTORY_REG(SquareSumV2)
-
- /**
- *@brief Confuse reducesumd and square. \n
-
- *@par Inputs:
- *x: A Tensor of type float16, float32. \n
-
- *@par Attributes:
- * Two attributes, including: \n
- *@li axis: A optional listint, specifies the dimensions to reduce.
- *@li keep_dims: A bool, specifying whether to keep dimensions for the output Tensor. Defaults to "false". \n
-
- *@par Outputs:
- y: A Tensor. Has the same type as "x".
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(SquareSumV1)
- .INPUT(x, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT16,DT_FLOAT}))
- .REQUIRED_ATTR(axis, ListInt)
- .ATTR(keep_dims, Bool, false)
- .OP_END_FACTORY_REG(SquareSumV1)
-
- /**
- *@brief Calculate square of Tensor and then reducesum
-
- *@par Inputs:
- *x1: A Tensor of type float32.
- *x2: A Tensor of type float32. \n
-
- *@par Outputs:
- y1: A Tensor. Has the same type as "x1".The result of "x1".
- y2: A Tensor. Has the same type as "x2".The result of "x2".
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(SquareSumAll)
- .INPUT(x1, TensorType({DT_FLOAT}))
- .INPUT(x2, TensorType({DT_FLOAT}))
- .OUTPUT(y1, TensorType({DT_FLOAT}))
- .OUTPUT(y2, TensorType({DT_FLOAT}))
- .OP_END_FACTORY_REG(SquareSumAll)
-
- /**
- *@brief Confuse broadcast, addn and mul. \n
-
- *@par Inputs:
- *Three inputs, including:
- * @li x1: A Tensor. Must be one of the following types:int32, int16, float16, float32.
- * @li x2: A Tensor of the same type as "x1".
- * @li x3: A Tensor of the same type as "x1". \n
-
- *@par Outputs:
- * y: A Tensor. Has the same type as "x1".
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(FusedMulAddN)
- .INPUT(x1, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT16}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT16}))
- .INPUT(x3, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT16}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT16}))
- .OP_END_FACTORY_REG(FusedMulAddN)
-
- /**
- *@brief Add 'bias' to 'x'. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x: An ND tensor of type float16 or float32.
- *@li bias: An ND tensor of type float16 or float32. \n
-
- *@par Attributes:
- *@li axis: An optional int32 used to compute the shape of bias input from the online bottoms. Defaults to "1".
- *@li num_axes: An optional int32 used to compute the shape of bias input from a Caffe model trained offline. Defaults to "1".
- *@li bias_from_blob: An optional bool. If "true", bias is input from a Caffe model trained offline. If "false", bias is input from online bottoms. Defaults to "true". \n
-
- *@par Outputs:
- *y: An ND tensor of type float16 or float32. \n
-
- *@attention Constraints:\n
- * Assume that the shape length of "x" is "n" and that of "bias" is "m".
- *@li "axis" is within the range [-n, n-1]. num_axes >= -1.
- *@li If "bias_from_blob = true", "num_axes = -1", and "axis >= 0", the ith axis of "bias" and the (i+"axis")th axis of "x" must have the same size (0 <= i < n-axis).\n
- * If "axis < 0", the ith axis of "bias" and the (i+n+"axis")th axis of "x" must have the same size (0 <= i < -axis).
- *@li If "bias_from_blob = true" and "num_axes = 0", "bias" is a scalar with shape length 1 and dimension size 1.
- *@li If "bias_from_blob = true", "num_axes > 0, and "axis >= 0", "axis + num_axes" must be less than or equal to "n" and the ith axis of "bias" and the (i+"axis")th axis of "x" must have the same size (0 <= i < num_axes).\n
- * If "axis < 0", "n + axis + num_axes" must be less than or equal to "n" and the ith axis of "bias" and the (i+n+"axis")th axis of "x" must have the same size (0 <= i < num_axes).
- *@li If "bias_from_blob = false", "bias" is not a scalar, and "axis >= 0","axis + m" must be less than or equal to "n" and the ith axis of "bias" and the (i+"axis")th axis of "x" must have the same size (0 <= i < m).\n
- * If "axis < 0", "n + axis + m" must be less than or equal to "n" and the ith axis of "bias" and the (i+n+"axis")th axis of "x" must have the same size (0 <= i < m).
- *@par Third-party framework compatibility
- * Compatible with the Caffe operator Bias.
- */
-
- REG_OP(Bias)
- .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16})) /* "First operand." */
- .INPUT(bias, TensorType({DT_FLOAT, DT_FLOAT16})) /* "Second operand." */
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16})) /* "Result, has same element type as x" */
- .ATTR(axis, Int, 1)
- .ATTR(num_axes, Int, 1)
- .ATTR(bias_from_blob, Bool, true)
- .OP_END_FACTORY_REG(Bias)
-
- /**
- *@brief Function multiply gradients calculation.
- output0 is the result of which input0 dot multily input1.
- output1 is the result of which input0 dot multily input1, then reducesum it. \n
-
- *@par Inputs:
- *@li input0: A Tensor of input of mul, and dtype supports float16, float32.
- *@li input1: A Tensor of input of mul and mul_1, and dtype supports float16, float32.
- *@li input2: A Tensor of input of mul_1, and dtype supports float16, float32. \n
-
- *@par Attributes:
- *@li axes: The dimensions to reduce. Default:(), reduce all dimensions. \n
- Only constant value is allowed.
- *@li keep_dims: If true, keep these reduced dimensions and the length is 1. \n
- If false, don’t keep these dimensions. Default:False. \n
-
- *@par Outputs:
- *@li output0: A Tensor result of which input0 dot multily input1.
- *@li output1: A Tensor result of which input0 dot multily input1, then reducesum it.
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(ConfusionMulGrad)
- .INPUT(input0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .INPUT(input2, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output0, TensorType({DT_FLOAT16,DT_FLOAT}))
- .OUTPUT(output1, TensorType({DT_FLOAT16,DT_FLOAT}))
- .ATTR(axes, ListInt, {})
- .ATTR(keep_dims, Bool, false)
- .OP_END_FACTORY_REG(ConfusionMulGrad)
-
- /**
- *@brief Function fused multiply l2 loss calculation. \n
-
- *@par Inputs:
- *@li x1: A Tensor of type float16, float32.
- *@li x2: A Tensor of type float16, float32.
- *@li x3: A Tensor of type float16, float32. \n
-
- *@par Outputs:
- *@li y1: A Tensor of shape and dtype of first output, which should have \n
- shape (1,) and dtype as input.
- *@li y2: A Tensor of shape and dtype of second output, should be same shape and type as input.
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(FusedMulAddNL2loss)
- .INPUT(x1, TensorType::NumberType())
- .INPUT(x2, TensorType::NumberType())
- .INPUT(x3, TensorType::NumberType())
- .OUTPUT(y1, TensorType::NumberType())
- .OUTPUT(y2, TensorType::NumberType())
- .OP_END_FACTORY_REG(FusedMulAddNL2loss)
-
- /**
- *@brief Tests whether the input exceeds a threshold. \n
-
- *@par Inputs:
- * x: A Tensor with any format. Must be one of the following types: float16, float32. \n
-
- *@par Attributes:
- * threshold: A required float32. Defaults to "0.0". "x" is compared with "threshold", outputs "1" for inputs above threshold; "0" otherwise. \n
-
- *@par Outputs:
- * y: A Tensor with any format. Has the same type as the input. Must be one of the following types: float16, float32.
- *@par Third-party framework compatibility
- * Compatible with the Caffe operator Threshold.
- */
-
- REG_OP(Threshold)
- .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16}))
- .ATTR(threshold, Float, 0.0)
- .OP_END_FACTORY_REG(Threshold);
-
- /**
- *@brief Returns the index number corresponding to the maximum value entered. \n
-
- *@par Inputs:
- *@li x: A tensor. Must be one of the following types: float16, float32. \n
-
- *@par Attributes:
- *@li axis: An optional int. Specify the axis to be cut at the input tensor. If this parameter is not provided, find the topk for each batch. Defaults to 10000
- *@li out_max_val: An optional bool. Whether to output the maximum value. If it is True, the maximum value and index are output, otherwise only the index is output.
- * Defaults to False
- *@li topk: An optional int. It means the number of top tok in each axis (the value is greater than or equal to 1), and the value range must be in [1,x.shape(axis)].
- * Defaults to 1
-
- *@par Outputs:
- *@li indices: A tensor of type float16, float32, int32. The index of the maximum value of the output.
- *@li values: A tensor of type float16, float32.Output tensor, including maximum index or maximum value.
- *@par Third-party framework compatibility
- * Compatible with the Caffe operator ArgMax.
- */
- REG_OP(ArgMaxWithK)
- .INPUT(x, TensorType({DT_FLOAT, DT_FLOAT16}))
- .OUTPUT(indices, TensorType({DT_INT32, DT_FLOAT, DT_FLOAT16}))
- .OUTPUT(values, TensorType({DT_FLOAT, DT_FLOAT16}))
- .ATTR(axis, Int, 10000)
- .ATTR(out_max_val, Bool, false)
- .ATTR(topk, Int, 1)
- .OP_END_FACTORY_REG(ArgMaxWithK)
-
- /**
- *@brief Multiply tensor with scale. \n
-
- *@par Inputs:
- *One input, including:
- *x: A Tensor. Must be one of the following types:int32,int16, float16, float32.
-
- *@par Outputs:
- *y: A Tensor. Has the same type and shape as "x1". \n
-
- *@par Third-party framework compatibility:
- * Compatible with the Pytorch operator muls.
- */
- REG_OP(Muls)
- .INPUT(x, TensorType({DT_FLOAT,DT_INT16,DT_INT32,DT_FLOAT16}))
- .OUTPUT(y, TensorType({DT_FLOAT,DT_INT16,DT_INT32,DT_FLOAT16}))
- .REQUIRED_ATTR(value, Float)
- .OP_END_FACTORY_REG(Muls)
-
- /**
- *@brief Fill tensor with scale. \n
-
- *@par Inputs:
- *One input, including:
- *x1: A Tensor. Must be one of the following types:int32,int16, float16, float32.
-
- *@par Outputs:
- *y: A Tensor. Has the same type and shape as "x1". \n
-
- *@par Third-party framework compatibility:
- * Compatible with the Pytorch operator fills.
- */
- REG_OP(Fills)
- .INPUT(x, TensorType({DT_FLOAT,DT_INT16,DT_INT32,DT_FLOAT16}))
- .OUTPUT(y, TensorType({DT_FLOAT,DT_INT16,DT_INT32,DT_FLOAT16}))
- .REQUIRED_ATTR(value,Float)
- .OP_END_FACTORY_REG(Fills)
-
- /**
- *@brief Add tensor with scale. \n
-
- *@par Inputs:
- *One input, including: \n
- *x: A Tensor. Must be one of the following types:int32,int16, float16, float32. \n
-
- *@par Attributes:
- *value: A scale. Must be float. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type and shape as "x1". \n
-
- *@par Third-party framework compatibility:
- * Compatible with the Pytorch operator adds.
- */
- REG_OP(Adds)
- .INPUT(x, TensorType({DT_FLOAT,DT_INT16,DT_INT32,DT_FLOAT16}))
- .OUTPUT(y, TensorType({DT_FLOAT,DT_INT16,DT_INT32,DT_FLOAT16}))
- .REQUIRED_ATTR(value,Float)
- .OP_END_FACTORY_REG(Adds)
-
- /**
- *@brief Computes the product of x and y and returns 0 if the y is zero, even if x is NaN or infinite. \n
-
- *@par Inputs:
- * @li x1: A Tensor. Must be one of the following types:float16, float32, double, complex64, complex128.
- * @li x2: A Tensor. Has the same type and shape as "x1". \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type and shape as "x1". \n
-
- *@par Third-party framework compatibility:
- * Compatible with the TensorFlow operator MulNoNan.
- */
- REG_OP(MulNoNan)
- .INPUT(x1, TensorType::NumberType()) /* "First operand." */
- .INPUT(x2, TensorType::NumberType()) /* "Second operand." */
- .OUTPUT(y, TensorType::NumberType()) /* "Result, has same element type as two inputs" */
- .OP_END_FACTORY_REG(MulNoNan)
-
- /**
- *@brief Add tensor with scale. \n
-
- *@par Inputs:
- * @li x1: A Tensor dtype of int32, float16, float32.
- * @li x2: A Tensor dtype of int32, float16, float32. \n
-
- *@par Attributes:
- *alpha: Float scalar apply to x2:x2*alpha
-
- *@par Outputs:
- *y: A Tensor. should be same shape and type as "x1". \n
-
- *@par Third-party framework compatibility:
- * Compatible with the Pytorch operator Axpy.
- */
- REG_OP(Axpy)
- .INPUT(x1, TensorType({DT_FLOAT, DT_INT32, DT_FLOAT16}))
- .INPUT(x2, TensorType({DT_FLOAT, DT_INT32, DT_FLOAT16}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_INT32, DT_FLOAT16}))
- .REQUIRED_ATTR(alpha, Float)
- .OP_END_FACTORY_REG(Axpy)
-
- /**
- *@brief Creates a criterion that measures the loss given input tensors x1 x2 and a Tensor label y with values 1 or -1. \n
-
- *@par Inputs:
- *@li x1: A ND Tensor with one of the following types: int8, uint8, int32, float16, float32.
- *@li x2: A ND Tensor with one of the following types: int8, uint8, int32, float16, float32.
- *@li target: A ND Tensor with one of the following types: int8, int32, float16, float32. \n
-
- *@par Attributes:
- *@li margin: A optional float32. Defaults to "0.0".
- *@li reduction: A optional string. Defaults to "mean". \n
-
- *@par Outputs:
- *@li y: A ND Tensor with Must be float32.
- *@par Third-party framework compatibility
- * Compatible with the PyTorch operator CosineEmbeddingLoss.
- */
- REG_OP(CosineEmbeddingLoss)
- .INPUT(x1, TensorType({DT_INT8, DT_UINT8, DT_INT16, DT_INT32, DT_INT64, DT_FLOAT16, DT_FLOAT, DT_DOUBLE}))
- .INPUT(x2, TensorType({DT_INT8, DT_UINT8, DT_INT16, DT_INT32, DT_INT64, DT_FLOAT16, DT_FLOAT, DT_DOUBLE}))
- .INPUT(target, TensorType({DT_INT8, DT_UINT8, DT_INT16, DT_INT32, DT_INT64, DT_FLOAT16, DT_FLOAT, DT_DOUBLE}))
- .ATTR(margin, Float, 0)
- .ATTR(reduction, String, "mean")
- .OUTPUT(y, TensorType({DT_FLOAT}))
- .OP_END_FACTORY_REG(CosineEmbeddingLoss)
-
- /**
- *@brief Kullback-Leibler divergence. \n
-
- *@par Inputs:
- * Two inputs, including:
- *@li x: Tensor of arbitrary shape.
- *@li target: Tensor of the same shape and dtype as x. \n
-
- *@par Attributes:
- *reduction: An required "string", Specifies the reduction to apply to the output;
- * Reduction only supports the two modes of "sum" and "batchmean". \n
-
- *@par Outputs:
- *y: A ND Tensor of the same dtype as x.
- *@par Third-party framework compatibility
- *Compatible with the PyTorch operator kl_div.
- */
- REG_OP(KLDiv)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE}))
- .INPUT(target, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE}))
- .REQUIRED_ATTR(reduction, String)
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_DOUBLE}))
- .OP_END_FACTORY_REG(KLDiv)
-
- /**
- *@brief copy data from x to y.. \n
-
- *@par Inputs:
- *One inputs, including:
- * @li x: A Tensor. Must be one of the following types: float16, float32, int8, uint8, int32, bool. \n
-
- *@par Outputs:
- *y: A Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
-
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- */
- REG_OP(TensorMove)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT8, DT_UINT8, DT_BOOL}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT8, DT_UINT8, DT_BOOL}))
- .OP_END_FACTORY_REG(TensorMove)
-
- /**
- *@brief copy data from x to x. \n
-
- *@par Inputs:
- *One inputs, including:
- *x: A Tensor. Must be one of the following types: float16, float32, int8, uint8, int16, uint16, int32, uint32, int64, uint64. \n
-
- *@par Outputs:
- *output_x: A Tensor. Has the same type as "x". \n
-
- *@par Third-party framework compatibility
- */
- REG_OP(TensorRedirect)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8,
- DT_INT64, DT_INT16, DT_UINT16, DT_UINT64, DT_UINT32}))
- .OUTPUT(output_x, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8,
- DT_INT64, DT_INT16, DT_UINT16, DT_UINT64, DT_UINT32}))
- .OP_END_FACTORY_REG(TensorRedirect)
-
- /**
- * @brief Performs the element-wise division of tensor x2 by tensor x3,
- * multiply the result by the scalar value and add it to tensor x1
-
- * @par Inputs:
- * Four inputs, including:
- * @li input_data: A mutable input Tensor. Must be one of the following types:
- * float16, float32.
- * @li x1: A mutable input Tensor of the same type as x1.
- * @li x2: A mutable input Tensor of the same type as x1.
- * @li value: A mutable input Tensor. Must be one of the following types:
- * float16, float32, int32. \n
-
- * @par Outputs:
- * y: A mutable Tensor. Has the same type as "x1". \n
-
- * @par Third-party framework compatibility
- * Compatible with the Pytorch operator Addcdiv.
- */
- REG_OP(Addcdiv)
- .INPUT(input_data, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(value, TensorType({ DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OP_END_FACTORY_REG(Addcdiv)
-
- /**
- * @brief Performs the element-wise multiplication of tensor x2 by tensor x3,
- * multiply the result by the scalar value and add it to tensor input_data
-
-
- * @par Inputs:
- * Four inputs, including:
- * @li input_data: A mutable input Tensor. Must be one of the following types:
- * float16, float32, int8, int32, uint8.
- * @li x1: A mutable input Tensor of the same type as x1.
- * @li x2: A mutable input Tensor of the same type as x1.
- * @li value: A tensor which includes only one element of the same type as x1. \n
-
- * @par Outputs:
- * y: A mutable output Tensor. Has the same type as "x1". \n
-
- * @par Third-party framework compatibility
- * Compatible with the Pytorch operator Addcmul.
- */
- REG_OP(Addcmul)
- .INPUT(input_data, TensorType({ DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8 }))
- .INPUT(x1, TensorType({ DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8 }))
- .INPUT(x2, TensorType({ DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8 }))
- .INPUT(value, TensorType({ DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8 }))
- .OUTPUT(y, TensorType({ DT_FLOAT16, DT_FLOAT, DT_INT8, DT_INT32, DT_UINT8 }))
- .OP_END_FACTORY_REG(Addcmul)
-
- /**
- * @brief Computes the result of x2 * alpha + x1.
-
- * @par Inputs:
- * @li x1: An ND tensor of type float16, float32, int32.
- * @li x2: An ND tensor of type float16, float32, int32.
- * @li alpha: A scalar tensor of type float16, float32. \n
-
- * @par Outputs:
- * y: An ND tensor tensor with the same shape and type as "x1". \n
-
- * @par Third-party framework compatibility
- * Compatible with the Pytorch operator Axpy.
- */
- REG_OP(AxpyV2)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .INPUT(alpha, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .OP_END_FACTORY_REG(AxpyV2)
-
- /**
- * @brief Computes the result of x1 - x2.
-
- * @par Inputs:
- * @li x1: An ND tensor of type float16, float, int32.
- * @li x2: An ND tensor of type float16, float, int32. \n
-
- * @par Outputs:
- * @li y: An ND tensor tensor with the same type as "x1". \n
-
- * @par Third-party framework compatibility
- * Compatible with the Pytorch operator Sub.
- */
- REG_OP(PtSub)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .OP_END_FACTORY_REG(PtSub)
-
- /**
- * @brief Add the partial values of two tensors in format NC1HWC0.
-
- * @par Inputs:
- * @li x1: A Tensor in 5HD, and must be one of the following types: float16,
- * float32. \n
- * @li x2: A Tensor of the same type as "x1", and the same shape as "x1",
- * except for the C1 value. \n
-
- * @par Attributes:
- * @li x1_c1_offset: A required int. Offset value of C1 in "x1". \n
- * @li x2_c1_offset: A required int. Offset value of C1 in "x2". \n
- * @li c1_len: A required int. C1 len of "y". The value must be less than
- * the difference between C1 and offset in "x1" and "x2". \n
-
- * @par Outputs:
- * @li y: A Tensor of the same type as "x1", and the same shape as "x1",
- * except for the C1 value. Record the result after adding. \n
- */
- REG_OP(StrideAdd)
- .INPUT(x1, TensorType({ DT_FLOAT, DT_FLOAT16 }))
- .INPUT(x2, TensorType({ DT_FLOAT, DT_FLOAT16 }))
- .OUTPUT(y, TensorType({ DT_FLOAT, DT_FLOAT16 }))
- .REQUIRED_ATTR(x1_c1_offset, Int)
- .REQUIRED_ATTR(x2_c1_offset, Int)
- .REQUIRED_ATTR(c1_len, Int)
- .OP_END_FACTORY_REG(StrideAdd)
-
- /**
- * @brief Compare two tensors are totally equal or not, only output a bool value"
-
- * @par Inputs:
- * Two inputs, including:
- * @li input_x: A Tensor. the first tensor. \n
- * @li input_y: A Tensor. the second tensor. \n
-
- * @par Outputs:
- * @li output_z: A Tensor. Bool type, compare result of the two inputs. \n
-
- * @par Third-party framework compatibility
- * Compatible with the Pytorch equal operator. \n
- */
- REG_OP(TensorEqual)
- .INPUT(input_x, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT8, DT_UINT8}))
- .INPUT(input_y, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32, DT_INT8, DT_UINT8}))
- .OUTPUT(output_z, TensorType({DT_BOOL}))
- .OP_END_FACTORY_REG(TensorEqual)
-
- /**
- * @brief Element-wise min of each of the input tensors (with Numpy-style broadcasting support).
- * All inputs and outputs must have the same data type. This operator supports multidirectional
- * (i.e., Numpy-style) broadcasting
- *
- * @par Inputs:
- * one input including:
- * x: dynamic input A Tensor. Must be one of the following types: float32, float16, double, int32, int64
- *
- * @par Outputs:
- * one output including:
- * y:A Tensor of the same type as x
- *
- */
- REG_OP(MaxN)
- .DYNAMIC_INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT, DT_FLOAT64, DT_INT32, DT_INT64}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT, DT_FLOAT64, DT_INT32, DT_INT64}))
- .OP_END_FACTORY_REG(MaxN)
-
-
- /**
- * @brief Calculates x * maske * value.
- *
- * @par Inputs:
- * @li x: An tensor of type float16 or float32, specifying the input to the data layer.
- * @li mask: An tensor of type int8 or float16 or float32, be same shape with x. \n
- *
- * @par Attributes:
- * value: A optional float. \n
- *
- * @par Outputs:
- * y: The output tensor of type float16 or float32.
- @ li y:A Tensor of the same type and shape as x
- *
- */
- REG_OP(MaskedScale)
- .INPUT(x, TensorType({DT_FLOAT16, DT_FLOAT32}))
- .INPUT(mask, TensorType({DT_INT8, DT_FLOAT16, DT_FLOAT32}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT32}))
- .REQUIRED_ATTR(value, Float)
- .OP_END_FACTORY_REG(MaskedScale)
-
- /**
- * @brief Calculate the lerp function. \n
-
- * @par Inputs:
- * Three inputs, including:
- * @li start: A tensor. Must be one of the following types:
- * float16, float32. \n
- * @li end: A tensor. Must be one of the following types:
- * float16, float32. \n
- * @li weight: A tensor. Must be one of the following types:
- * float16, float32. \n
-
- * @par Outputs:
- * y: A Tensor with the same type and shape of input_x's. \n
-
- * @par Third-party framework compatibility
- * Compatible with the Pytorch operator Lerp. \n
- */
- REG_OP(Lerp)
- .INPUT(start, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(end, TensorType({DT_FLOAT16, DT_FLOAT}))
- .INPUT(weight, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .OP_END_FACTORY_REG(Lerp)
-
- /**
- *@brief Returns the num value of abs(x1-x2) > atol+rtol*abs(x2) element-wise. \n
-
- *
- *@par Inputs:
- *@li x1: A tensor. Must be one of the following types: float32, int32, uint8, int8, float16
- *@li x2: A tensor of the same type as "x1".
- *
- *@par Attributes:
- * atol: Defaults to "1e-05".
- * rtol: Defaults to "1e-03".
- *
- *@par Outputs:
- * num: A tensor of type float32.
- *
- *@par Restrictions:
- *Warning: THIS FUNCTION IS EXPERIMENTAL. Please do not use.
- *
- */
- REG_OP(DataCompare)
- .INPUT(x1, TensorType({ DT_FLOAT16, DT_FLOAT,DT_INT8, DT_UINT8, DT_INT32 }))
- .INPUT(x2, TensorType({ DT_FLOAT16, DT_FLOAT,DT_INT8, DT_UINT8, DT_INT32 }))
- .OUTPUT(num, TensorType({DT_FLOAT}))
- .ATTR(atol, Float, 1e-5)
- .ATTR(rtol, Float, 1e-3)
- .OP_END_FACTORY_REG(DataCompare)
-
- /**
- *@brief Hardmax(element in input, axis) = 1 if the element is the first maximum value along the specified axis, 0
- *otherwise The input does not need to explicitly be a 2D vector.The "axis" attribute indicates the dimension along
- *which Hardmax will be performed.The output tensor has the same shape and contains the Hardmax values of the
- *corresponding input.
- *
- *@par Inputs:
- *one input including:
- *x: input A Tensor.Must be one of the following types:float32,float16
- *
- *@par Attributes:
- *axis:A required int attribute that decides which dimension will be used to cal the hard_max
- *
- *@par Outputs:
- *one output including:
- *y:A Tensor of the same type as x
- *
- */
- REG_OP(HardMax)
- .INPUT(x, TensorType({ DT_FLOAT16, DT_FLOAT }))
- .OUTPUT(y, TensorType({DT_FLOAT16, DT_FLOAT}))
- .ATTR(axis, Int, -1)
- .OP_END_FACTORY_REG(HardMax)
-
- /**
- * @brief Computes the dot product (inner product) of two tensors. This function does not broadcast.
-
- * @par Inputs:
- * Two inputs, including:
- * @li input_x: A Tensor. the first tensor must be 1d. \n
- * @li input_y: A Tensor. the second tensor must be 1d. \n
-
- * @par Outputs:
- * @li output: A Tensor. Result of the two inputs, must be 1d. \n
-
- * @par Third-party framework compatibility
- * Compatible with the Pytorch dot operator. \n
- */
- REG_OP(Dot)
- .INPUT(input_x, TensorType({DT_FLOAT, DT_FLOAT16, DT_UINT8, DT_INT8, DT_INT32}))
- .INPUT(input_y, TensorType({DT_FLOAT, DT_FLOAT16, DT_UINT8, DT_INT8, DT_INT32}))
- .OUTPUT(output, TensorType({DT_FLOAT, DT_FLOAT16, DT_UINT8, DT_INT8, DT_INT32}))
- .OP_END_FACTORY_REG(Dot)
-
- /**
- *@brief Returns a new tensor with boolean elements representing \n
- *if each element of input is “close” to the corresponding element of other \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li x1: A tensor. Must be one of the following types:
- * float16, float32, int32. \n
- * @li x2: A tensor with the same type and shape of x1's. \n
-
- *@par Attributes:
- *@li rtol: An optional float.Defaults to 1e-05. \n
- *@li atol: An optional float.Defaults to 1e-08. \n
- *@li equal_nan: An optional bool.Defaults to false. \n
-
- *@par Outputs:
- *y: A Tensor bool with the same shape of x1's. \n
-
- *@par Third-party framework compatibility
- *Compatible with the Pytorch operator isclose. \n
- */
- REG_OP(IsClose)
- .INPUT(x1, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .INPUT(x2, TensorType({DT_FLOAT16, DT_FLOAT, DT_INT32}))
- .OUTPUT(y, TensorType({DT_BOOL}))
- .ATTR(rtol, Float, 1e-05)
- .ATTR(atol, Float, 1e-08)
- .ATTR(equal_nan, Bool, false)
- .OP_END_FACTORY_REG(IsClose)
-
- /**
- * @brief Returns the reverse tensor of the ArgMax operator of a tensor. \n
-
- * @par Inputs:
- * three input, including:
- * var: A Tensor of type float16, float32, int32 or int8. \n
- * indices: A Tensor of type int32. \n
- * updates: A Tensor of type float16, float32, int32 or int8. \n
-
- * @par Attributes:
- * @li dimension: An integer of type int, specifying the axis information of the index with the maximum value.\n
-
- * @par Outputs:
- * y: A Tensor of type float16, float32, int32 or int8. \n
- *
- *@attention Constraints:
- *@li indices: only support int32,and shape same to "updates"
- *@li The value range of "dimension" is [-dims, dims - 1]. "dims" is the dimension length of "x".
- *@li y:A Tensor, the type and shape is same to "var" \n
-
- *@par Third-party framework compatibility
- * not support all scene like pytorch operator scatter
- * exp:
- * var.shape=[2,3,4,5], dim=2, the shape of indices and updates should be [2,3,5]
- * not support the shape of indices and updates is [2,3,2,5] like pytorch operator scatter. \n
- */
- REG_OP(ArgMaxGrad)
- .INPUT(var, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .INPUT(indices, TensorType({DT_INT32}))
- .INPUT(updates, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .REQUIRED_ATTR(dimension, Int)
- .OP_END_FACTORY_REG(ArgMaxGrad)
-
- /**
- * @brief Returns the reverse tensor of the ArgMax operator of a tensor. \n
-
- * @par Inputs:
- * three input, including:
- * var: A Tensor of type float16, float32, int32 or int8. \n
- * indices: A Tensor of type int32. \n
- * updates: A Tensor of type float16, float32, int32 or int8. \n
- * assist: A Tensor of int32,also a assist matrix and it's shape must match the shape of var \n
-
- * @par Attributes:
- * @li dimension: An integer of type int, specifying the axis information of the index with the maximum value.\n
-
- * @par Outputs:
- * y: A Tensor of type float16, float32, int32 or int8. \n
-
- *@attention Constraints:
- *@li indices: only support int32,and shape same to "updates"
- *@li The value range of "dimension" is [-dims, dims - 1]. "dims" is the dimension length of "x".
- *@li y:A Tensor, the type and shape is same to "var" \n
-
- *@par Third-party framework compatibility
- * not support all scene like pytorch operator scatter
- * exp:
- * var.shape=[2,3,4,5], dim=2, the shape of indices and updates should be [2,3,5]
- * not support the shape of indices and updates is [2,3,2,5] like pytorch operator scatter. \n
- */
- REG_OP(ArgMaxGradD)
- .INPUT(var, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .INPUT(indices, TensorType({DT_INT32}))
- .INPUT(updates, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .INPUT(assist, TensorType({DT_INT32}))
- .OUTPUT(y, TensorType({DT_FLOAT, DT_FLOAT16, DT_INT32, DT_INT8}))
- .REQUIRED_ATTR(dimension, Int)
- .OP_END_FACTORY_REG(ArgMaxGradD)
-
- /**
- *@brief Calculates the reversed outputs of the function "AddMatMatElements"
- * c = c * beta + alpha * a * b
-
- *@par Inputs:
- *Three inputs, including:
- * @li c: A mutable Tensor. Must be one of the following types:
- * float16, float32.
- * @li a: A mutable Tensor of the same type as "c".
- * @li b: A mutable Tensor of the same type as "c".
- * @li beta: A mutable scalar of the same type as "c".
- * @li alpha: A mutable scalar of the same type as "c". \n
-
- *@par Outputs:
- * @li c: A mutable Tensor. Has the same type as "c". \n
-
- *@par Third-party framework compatibility
- * Compatible with the TensorFlow operator AddMatMatElements.
- */
- REG_OP(AddMatMatElements)
- .INPUT(c, TensorType({DT_FLOAT, DT_FLOAT16}))
- .INPUT(a, TensorType({DT_FLOAT, DT_FLOAT16}))
- .INPUT(b, TensorType({DT_FLOAT, DT_FLOAT16}))
- .INPUT(beta, TensorType({DT_FLOAT, DT_FLOAT16}))
- .INPUT(alpha, TensorType({DT_FLOAT, DT_FLOAT16}))
- .OUTPUT(c, TensorType({DT_FLOAT, DT_FLOAT16}))
- .OP_END_FACTORY_REG(AddMatMatElements)
-
- /**
- *@brief Returns cosine similarity between x1 and x2,computed along dim. \n
-
- *@par Inputs:
- *Two inputs, including:
- * @li input_x1: A tensor. Must be the following types:
- * float32. \n
-
- *@par Inputs:
- *@li input_x2: A tensor. Must of the following types:
- * float32. \n
-
- *@par Outputs:
- *@li output_y: A Tensor with the same type of input_x's. \n
-
- *@par Third-party framework compatibility
- *Compatible with the Pytorch operator CosineSimilarity. \n
- */
- REG_OP(CosineSimilarity)
- .INPUT(input_x1, TensorType({DT_FLOAT})) /* "First operand." */
- .INPUT(input_x2, TensorType({DT_FLOAT})) /* "Second operand." */
- .OUTPUT(output_y, TensorType({DT_FLOAT})) /* "Result, has same element type as two inputs" */
- .ATTR(dim, Int, 1)
- .ATTR(eps, Float, 1e-8)
- .OP_END_FACTORY_REG(CosineSimilarity)
-
- } // namespace ge
-
- #endif // OPS_BUILT_IN_OP_PROTO_INC_ELEWISE_CALCULATION_OPS_H_
|