@@ -78,7 +78,7 @@ LongType ShapeDescriptor::offset() {
7878}
7979
8080ShapeDescriptor::ShapeDescriptor (const DataType type, const char order, const LongType *shape, const LongType rank)
81- : _dataType(type ), _order(order), _rank(rank ) {
81+ : _rank(rank ), _order(order), _dataType(type ) {
8282 int rank2 = rank < 1 ? 1 : rank;
8383 _shape_strides = new LongType[2 * rank2];
8484 this ->ownsShapeStrides = true ;
@@ -102,7 +102,7 @@ ShapeDescriptor::ShapeDescriptor(const DataType type, const char order, const Lo
102102 fillStrides ();
103103
104104#if defined(SD_GCC_FUNCTRACE)
105- this -st.load_here ();
105+ this -> st .load_here ();
106106#endif
107107
108108
@@ -149,15 +149,15 @@ ShapeDescriptor::ShapeDescriptor(const DataType type, const char order, const Lo
149149 }
150150
151151#if defined(SD_GCC_FUNCTRACE)
152- this -st.load_here ();
152+ this -> st .load_here ();
153153#endif
154154}
155155
156156// ////////////////////////////////////////////////////////////////////////
157157
158158
159159ShapeDescriptor::ShapeDescriptor (const DataType type, const char order, const std::vector<LongType> &shape)
160- : _dataType(type ), _order(order ) {
160+ : _order(order ), _dataType(type ) {
161161 if (!DataTypeUtils::validDataType (_dataType)) {
162162 THROW_EXCEPTION (" Shape descriptor created with invalid data type" );
163163 }
@@ -190,7 +190,7 @@ ShapeDescriptor::ShapeDescriptor(const DataType type, const char order, const st
190190 THROW_EXCEPTION (" Shape descriptor created with invalid data type" );
191191 }
192192#if defined(SD_GCC_FUNCTRACE)
193- this -st.load_here ();
193+ this -> st .load_here ();
194194#endif
195195}
196196
@@ -204,12 +204,12 @@ ShapeDescriptor::ShapeDescriptor(const DataType type, const char order, const st
204204 THROW_EXCEPTION (" Shape descriptor created with invalid data type" );
205205 }
206206#if defined(SD_GCC_FUNCTRACE)
207- this -st.load_here ();
207+ this -> st .load_here ();
208208#endif
209209}
210210
211211ShapeDescriptor::ShapeDescriptor (const DataType type, const LongType length)
212- : _dataType(type ), _order(' c' ), _rank( 1 ), _extraProperties(0 ) {
212+ : _rank( 1 ), _order(' c' ), _dataType(type ), _extraProperties(0 ) {
213213 _shape_strides = new LongType [2 ];
214214 _shape_strides[0 ] = length;
215215 _shape_strides[1 ] = 1 ; // {shape, stride}
@@ -218,7 +218,7 @@ ShapeDescriptor::ShapeDescriptor(const DataType type, const LongType length)
218218 }
219219
220220#if defined(SD_GCC_FUNCTRACE)
221- this -st.load_here ();
221+ this -> st .load_here ();
222222#endif
223223}
224224
@@ -363,7 +363,7 @@ ShapeDescriptor::ShapeDescriptor(const LongType *shapeInfo, bool validateDataTyp
363363 }
364364
365365#if defined(SD_GCC_FUNCTRACE)
366- this -st.load_here ();
366+ this -> st .load_here ();
367367#endif
368368
369369}
@@ -387,7 +387,7 @@ ShapeDescriptor::ShapeDescriptor(const LongType *shapeInfo, const DataType dtype
387387 }
388388
389389#if defined(SD_GCC_FUNCTRACE)
390- this -st.load_here ();
390+ this -> st .load_here ();
391391#endif
392392}
393393
@@ -398,7 +398,7 @@ ShapeDescriptor::ShapeDescriptor(const LongType *shapeInfo, const LongType *dtyp
398398 }
399399
400400#if defined(SD_GCC_FUNCTRACE)
401- this -st.load_here ();
401+ this -> st .load_here ();
402402#endif
403403}
404404
@@ -412,7 +412,7 @@ ShapeDescriptor::ShapeDescriptor(const LongType *shapeInfo, const LongType *dtyp
412412
413413
414414#if defined(SD_GCC_FUNCTRACE)
415- this -st.load_here ();
415+ this -> st .load_here ();
416416#endif
417417}
418418
@@ -441,7 +441,7 @@ void ShapeDescriptor::print() const {
441441 printf (" %lld" , _shape_strides[i]);
442442 if (i < 2 * _rank - 1 ) printf (" , " );
443443 }
444- printf (" ], %c, %lld, % s, %lld\n " , _order, DataTypeUtils::asString (_dataType).c_str (), _extraProperties);
444+ printf (" ], %c, %s, %lld\n " , _order, DataTypeUtils::asString (_dataType).c_str (), _extraProperties);
445445}
446446
447447LongType ShapeDescriptor::allocLength () const {
@@ -549,7 +549,7 @@ DataType ShapeDescriptor::dataType() const {
549549}
550550
551551bool ShapeDescriptor::isEmpty () const { return (_extraProperties & ARRAY_EMPTY) == ARRAY_EMPTY; }
552- bool ShapeDescriptor::isScalar () const { return !isEmpty () && rank () == 0 || rank () == 1 && arrLength () == 1 ; }
552+ bool ShapeDescriptor::isScalar () const { return ( !isEmpty () && rank () == 0 ) || ( rank () == 1 && arrLength () == 1 ) ; }
553553
554554sd::LongType * ShapeDescriptor::shape_strides () { return _shape_strides; }
555555
@@ -568,21 +568,21 @@ ShapeDescriptor::ShapeDescriptor(const ShapeDescriptor &other) {
568568 this ->ownsShapeStrides = false ;
569569 _paddedAllocSize = other._paddedAllocSize ;
570570#if defined(SD_GCC_FUNCTRACE)
571- this -st.load_here ();
571+ this -> st .load_here ();
572572#endif
573573}
574574
575575// ////////////////////////////////////////////////////////////////////////
576576ShapeDescriptor::ShapeDescriptor (const DataType type, const char order, const std::vector<LongType> &shape,
577577 const std::vector<LongType> &strides)
578- : _dataType(type ), _order(order ) {
578+ : _order(order ), _dataType(type ) {
579579 _rank = shape.size ();
580580 int rank2 = _rank < 1 ? 1 : _rank;
581581
582582 _shape_strides = new LongType [2 * rank2];
583583 this ->ownsShapeStrides = true ;
584584#if defined(SD_GCC_FUNCTRACE)
585- this -st.load_here ();
585+ this -> st .load_here ();
586586#endif
587587 auto _shape = _shape_strides;
588588 auto _strides = _shape_strides + rank2;
@@ -677,11 +677,11 @@ ShapeDescriptor * ShapeDescriptor::paddedBufferDescriptor(const DataType type,
677677 descriptor->_shape_strides = new LongType [2 * rank2];
678678 auto _shape = descriptor->_shape_strides ;
679679 auto _strides = descriptor->_shape_strides + rank2;
680- for (int i = 0 ; i < shape.size (); i++) {
680+ for (size_t i = 0 ; i < shape.size (); i++) {
681681 _shape[i] = shape[i];
682682 }
683683 // calculate strides with paddings
684- int min_rank = descriptor->_rank > paddings.size () ? paddings.size () : rank2;
684+ int min_rank = static_cast < size_t >( descriptor->_rank ) > paddings.size () ? paddings.size () : rank2;
685685 bool is_continous = true ;
686686 if (order == ' c' ) {
687687 _strides[rank2 - 1 ] = 1L ;
@@ -705,7 +705,7 @@ ShapeDescriptor * ShapeDescriptor::paddedBufferDescriptor(const DataType type,
705705 if (pad != 0 ) is_continous = false ;
706706 }
707707 if (!is_continous && descriptor->_rank > 0 ) {
708- LongType size_pad = paddings.size () >= descriptor->_rank ? paddings[descriptor->_rank - 1 ] : 0 ;
708+ LongType size_pad = paddings.size () >= static_cast < size_t >( descriptor->_rank ) ? paddings[descriptor->_rank - 1 ] : 0 ;
709709 // alloc size should be supplied manually as we dont have place to store it
710710 descriptor->_paddedAllocSize = _strides[descriptor->_rank - 1 ] * (_shape[descriptor->_rank - 1 ] + size_pad);
711711 }
0 commit comments