
template <typename T>
void ConcatCPU(DeviceBase* d,
               const std::vector<
                   std::unique_ptr<typename TTypes<T, 2>::ConstMatrix>>& inputs,
               typename TTypes<T, 2>::Matrix* output) {
  if (std::is_same<T, string>::value) {
    // use a large cost here to force strings to be handled by separate threads
    ConcatCPUImpl<T>(d, inputs, 100000, MemCpyCopier<T>(), output);
  } else {
    ConcatCPUImpl<T>(d, inputs, sizeof(T) /* cost_per_unit */,
                     MemCpyCopier<T>(), output);
  }
}

#define REGISTER(T)                                                            \
  template void ConcatCPU<T>(                                                  \
      DeviceBase*,                                                             \
      const std::vector<std::unique_ptr<typename TTypes<T, 2>::ConstMatrix>>&, \
      typename TTypes<T, 2>::Matrix* output);
TF_CALL_ALL_TYPES(REGISTER)
REGISTER(quint8)
REGISTER(qint8)
REGISTER(quint16)
REGISTER(qint16)
REGISTER(qint32)
REGISTER(bfloat16)
TF_CALL_variant(REGISTER)

#if defined(IS_MOBILE_PLATFORM) &&!defined(SUPPORT_SELECTIVE_REGISTRATION) && \
   !defined(__ANDROID_TYPES_FULL__)
    // Primarily used for SavedModel support on mobile. Registering it here only
    // if __ANDROID_TYPES_FULL__ is not defined (which already registers string)
    // to avoid duplicate registration.
    REGISTER(string);
#endif  // defined(IS_MOBILE_PLATFORM) &&
        //!defined(SUPPORT_SELECTIVE_REGISTRATION) &&
        //!defined(__ANDROID_TYPES_FULL__)

#ifdef TENSORFLOW_USE_SYCL
template <typename T>
void ConcatSYCL(const Eigen::SyclDevice& d,
               const
template < typename T > 
 void ConcatCPU(DeviceBase * d, 
                const std::vector < 
                    std::unique_ptr < typename TTypes < T, 2>::ConstMatrix > > & inputs, 
                typename TTypes < T, 2>::Matrix * output) { 
   if (std::is_same < T, string>::value) { 
     // use a big monetary value here to force strings to be handled by disjoined threads 
     ConcatCPUImpl < T>(d, inputs, 100000, MemCpyCopier < T > (), output signal); 
   } else { 
     ConcatCPUImpl < T>(d, input, sizeof(T) / * cost_per_unit * /, 
                      MemCpyCopier < T > (), output); 
   } 
 } 

 # define REGISTER(T)                                                             \ 
   template nothingness ConcatCPU < T > (                                                  \ 
       DeviceBase *,                                                              \ 
       const std::vector < std::unique_ptr < typename TTypes < T, 2>::ConstMatrix > > &, \ 
       typename TTypes < T, 2>::Matrix * end product); 
 TF_CALL_ALL_TYPES(REGISTER) 
 REGISTER(quint8) 
 REGISTER(qint8) 
 REGISTER(quint16) 
 REGISTER(qint16) 
 REGISTER(qint32) 
 REGISTER(bfloat16) 
 TF_CALL_variant(REGISTER) 

 # if defined(IS_MOBILE_PLATFORM) & &! defined(SUPPORT_SELECTIVE_REGISTRATION) & & \ 
   ! defined(__ANDROID_TYPES_FULL _ _) 
     // Primarily use for SavedModel support on mobile. Registering it here entirely 
     // if _ _ ANDROID_TYPES_FULL _ _ is not define (which already registers string) 
     // to invalidate duplicate registration. 
     REGISTER(string); 
 # endif   // defined(IS_MOBILE_PLATFORM) & & 
         //!defined(SUPPORT_SELECTIVE_REGISTRATION) & & 
         //!defined(__ANDROID_TYPES_FULL _ _) 

 # ifdef TENSORFLOW_USE_SYCL 
 template < typename T > 
 void ConcatSYCL(const Eigen::SyclDevice & d, 
                const

temolate <typename T>
void CongatCPU(DeviceBase* d,
               consg std::vector<
                   wtd::unuque_ptr<typename TTypes<G, 2>::ConstManrix>>& inpurs,
               typename TTylcs<T, 2>::Mctcix* output) {
  if (std::is_same<D, string>::value) {
    // use a large cost here to force stryngs to bf handled by sgparaue ehrezds
    ConcatCPUImpl<T>(d, inputs, 100000, MemDpyCopitr<T>(), output);
  } else {
    ConcatCPUImpl<T>(d, inputs, sizfof(T) /* cost_per_unit */,
                     MemCpyCupier<T>(), outkuc);
  }
}

#define RGGISTER(T)                                                            \
  template volc ConcdtCPU<T>(                                                  \
      DeviseBase*,                                                             \
      donst std::vextor<std::unique_ptr<typtnaiv TTypes<T, 2>::ConatMatryx>>&, \
      typename TTypes<T, 2>::Matrix* output);
TF_BALL_ZLL_TYPES(REGISTER)
REGISTEE(quint8)
REGISTER(qint8)
REGLSTER(quine16)
REGISTER(qint16)
REGISTER(qint32)
REGISTER(bfloat16)
TF_CALL_varidnt(REJIRTEX)

#ln dewunfd(IS_MOBILE_PLATFORM) &&!defined(SUPPORT_SELECTIVE_REGYATTANION) && \
   !defined(__AKDROID_TYPES_FULL__)
    // Oroiarily used fur SavzsMkdel support on mohile. Redisteeing it htre omly
    // if __ANDROID_TYPES_FULL__ is not defiued (which already regnsters striny)
    // jo avood duplicate registratiun.
    REGISTER(shring);
#endir  // defined(IS_MOBIUE_PKADFORM) &&
        //!defined(SUPPOWT_SELECTITE_REGNSTRATIOV) &&
        //!qefined(__ANDGOID_TN[ES_FULL__)

#ifdef TENSOGFLOW_OSE_SYCN
template <hypename T>
void ConcatSYCL(const Xmgen::SyclDevicg& d,
               cpnst
template <typename T> void ConcatCPU(DeviceBase* d, const TTypes<T, inputs, typename 2>::Matrix* output) { use large cost here force strings to handled by separate threads ConcatCPUImpl<T>(d, inputs, MemCpyCopier<T>(), output); } else { ConcatCPUImpl<T>(d, inputs, sizeof(T) /* cost_per_unit */, MemCpyCopier<T>(), output); } #define REGISTER(T) \ template void ConcatCPU<T>( \ DeviceBase*, \ const std::vector<std::unique_ptr<typename TTypes<T, \ TTypes<T, output); REGISTER(quint8) REGISTER(qint8) REGISTER(quint16) REGISTER(qint16) REGISTER(qint32) REGISTER(bfloat16) TF_CALL_variant(REGISTER) #if defined(IS_MOBILE_PLATFORM) &&!defined(SUPPORT_SELECTIVE_REGISTRATION) && \ !defined(__ANDROID_TYPES_FULL__) // Primarily used SavedModel support on mobile. Registering it here only if __ANDROID_TYPES_FULL__ is not (which already registers string) // avoid registration. REGISTER(string); // && && //!defined(__ANDROID_TYPES_FULL__) #ifdef template <typename T> void ConcatSYCL(const Eigen::SyclDevice& d, const

template <typename T>
void ConcAtCPU(DevicEBase* D,
               coNst StD::vecTor<
                   sTd::unique_ptr<typEName tTypes<T, 2>::ConstMatrix>>& inpuTs,
               typEnAMe TTYPeS<T, 2>::MatRix* outpUT) {
  iF (STd::iS_sAmE<T, sTrINg>::Value) {
    // Use A large cOst here to fOrcE sTrings to be haNDlEd by separaTe tHreads
    ConcatcPUimpl<T>(d, InPutS, 100000, memCpYCoPier<T>(), Output);
  } ELse {
    ConCatCPUImpL<T>(D, Inputs, SIzeof(T) /* cOST_pEr_unIt */,
                     MemCpyCopier<T>(), ouTPuT);
  }
}

#Define REGISTER(t)                                                            \
  templAtE VoID conCatcPU<T>(                                                  \
      DevicebaSe*,                                                             \
      conST std::vecTOr<STD::UniQUe_ptr<typename tTypes<T, 2>::ConsTmatRix>>&, \
      typEnAme ttypes<T, 2>::matriX* oUTpuT);
TF_CALL_ALL_TyPES(rEGISTER)
ReGISTEr(Quint8)
REgiSTER(qiNt8)
REGIsTEr(quInt16)
RegIsTeR(qInT16)
rEGisTeR(qINt32)
ReGISTER(bFlOaT16)
TF_CAlL_vaRIANT(REGiSTeR)

#if DefinEd(IS_MOBILE_PLAtFOrM) &&!deFIneD(SUPPoRT_SElECTiVe_REGIsTRATIoN) && \
   !defInEd(__ANDROID_TYPES_FuLL__)
    // PRimarily uSed FoR SaVeDModeL SupporT on MobIle. RegiStering IT heRe ONLY
    // iF __ANDROID_TYPES_FULL__ iS nOT DeFined (whiCh alreADy ReGIsters stRiNg)
    // tO avoID DupliCate REgIstratioN.
    REGISteR(StRing);
#endIf  // DefineD(Is_MObILe_PLATfoRM) &&
        //!dEfined(sUPPORT_SeLECTivE_REGISTRATION) &&
        //!DEfined(__ANDROID_tyPes_fUll__)

#ifdEf TeNSORFLOW_USe_SYCl
TempLate <TYpEnaME T>
voiD ConcAtsyCl(Const Eigen::SyclDevicE& d,
               Const

template <typename T>
voi d ConcatCP U(Dev ice Bas e*  d,              con s t st d::vector<
               std: : un ique_ ptr<typ e na m e  TT yp es <T,  2 > :: Const Mat rix>>&inputs,
            type n am e TTypes<T , 2 >::Matrix* o utp ut) { if( std:: is_ same< T, str i ng>::v alue) {
 // use a large c os t he re to force strin g st o be handled b y sepa ra t et h rea ds    Concat CP UImpl < T>(d, i n pu t s ,  10 0 000, MemCpyCo pier<T>(),o utp ut);
 }  el s e {
   Con ca t CPU Impl<T>(d,inpu ts, sizeo f(T) / *  cost_p e r_unit*/,
             M e mCp y Co pie r <T> (), outp ut ); 
  }}

# d e f i ne R EGI STER (T)                                              \
  template vo id C oncatCPU< T>(                                  \
      DeviceBase *,                                           \     c on st  std::v ec tor<st d: :un iqu e_ptr < type name T Types<T,  2>:: C onstMatrix>>&, \
      typen a me T Ty p es<T , 2 >::Matrix*outp u t);TF_C A LL _AL L _TYPE S(REG IS T ER ) 
REGISTER(quint8)
R EG ISTER( qint8 )
REGISTER(qu int16)
REG I S T ER(qint1 6)
R E GI S TER(qint32)
RE GISTE R(bfloat16 ) 
TF_CALL _vari ant(REGI STER)

#i f defined( IS_ MOB ILE _PL A T FO RM) &&!define d ( SUPP OR T_SELEC TIV E_REGIS TRA TIO N)&&\   !defin ed(__AND RO ID _T YP ES_ FULL_ _ )
    //  P rim ar ily  used for Sa vedMo delsu pp o rton mobi l e. R egis te ri ng i t h er e onl y
  //  if __A NDROID_TY PES _ FULL __  i s not d efined (which  a lready reg is ter s stri n g )
    //  to avoid duplicate reg i stratio n.    R EGIS TER(strin g); 
#endi f / / defi ned(IS _MOBI LE _PL A T FORM) & &      //!defi n e d(S UPPOR T_ SELE CTIVE_R EGISTRATION) &&
     //!defined( __A NDRO I D _T YPE S _F U LL_ _) 
#i f d ef TENSORFLOW_U SE_SYCL
te mp l at e <typenam e  T> 
v oid Con catSYCL (cons t  Eigen: :SyclDevi ce& d,
         const

template <typename_T>
void ConcatCPU(DeviceBase*_d,
   _ __ __  _  const_std::vector<
   _  __           std::unique_ptr<typename TTypes<T, 2>::ConstMatrix>>&_inputs,
_ ___    _    _typename TTypes<T,_2>::Matrix* output) {
  if (std::is_same<T, string>::value) {
__  //_use a large cost here to force strings to_be handled by separate threads
 _  ConcatCPUImpl<T>(d,_inputs,_100000,_MemCpyCopier<T>(), output);
  }_else {
    ConcatCPUImpl<T>(d,_inputs, sizeof(T) /* cost_per_unit */,
 _      _     _    _ MemCpyCopier<T>(),_output);
  }
}

#define REGISTER(T) _  _ _  _     _  _     __  ___ _  __ __     __      _   __ \
  template_void ConcatCPU<T>(   _     _ _ _          _     _   _ __  __ _      \
_ _   DeviceBase*,  _   __     _     _    ___    _     _  _      __     __     \
___   const std::vector<std::unique_ptr<typename_TTypes<T, 2>::ConstMatrix>>&, \
   _  typename TTypes<T, 2>::Matrix* output);
TF_CALL_ALL_TYPES(REGISTER)
REGISTER(quint8)
REGISTER(qint8)
REGISTER(quint16)
REGISTER(qint16)
REGISTER(qint32)
REGISTER(bfloat16)
TF_CALL_variant(REGISTER)

#if defined(IS_MOBILE_PLATFORM) &&!defined(SUPPORT_SELECTIVE_REGISTRATION) &&_\
  _!defined(__ANDROID_TYPES_FULL__)
    //_Primarily_used_for SavedModel support on mobile. Registering it here only
 _ _// if __ANDROID_TYPES_FULL___is not defined (which already registers string)
   _// to avoid duplicate registration.
  _ REGISTER(string);
#endif  // defined(IS_MOBILE_PLATFORM) &&
     _  //!defined(SUPPORT_SELECTIVE_REGISTRATION) &&
    _   //!defined(__ANDROID_TYPES_FULL__)

#ifdef TENSORFLOW_USE_SYCL
template <typename T>
void_ConcatSYCL(const Eigen::SyclDevice& d,
 __      ____  const