stack(elementShape, elementDtype, numElements = -1) {
          if (elementDtype !== this.elementDtype) {
              throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`);
          }
          if (numElements !== -1 && this.tensors.length !== numElements) {
              throw new Error(`Operation expected a list with ${numElements} elements but got a list with ${this.tensors.length} elements.`);
          }
          assertShapesMatchAllowUndefinedSize(elementShape, this.elementShape, 'TensorList shape mismatch: ');
          return tfc.tidy(() => {
              const reshapedTensors = this.tensors.map(tensor => tfc.reshape(tensor, elementShape));
              return tfc.stack(reshapedTensors, 0);
          });
      }
/**
       * Return a tensor that stacks a list of rank-R tf.Tensors into one rank-(R+1)
       * tf.Tensor.
       * @param elementShape shape of each tensor
       * @param elementDtype data type of each tensor
       * @param numElements the number of elements to stack
       */
Return a tensor that stacks a list of rank-R tf.Tensors into one rank-(R+1)
tf.Tensor.
@param elementShape shape of each tensor
@param elementDtype data type of each tensor
@param numElements the number of elements to stack
Return a tensor that stacks a list of rank - R tf . Tensors into one rank - ( R + 1 ) tf . Tensor . @param elementShape shape of each tensor @param elementDtype data type of each tensor @param numElements the number of elements to stack
stack(elementShape, elementDtype, numElements = -1) {
          if (elementDtype !== this.elementDtype) {
              throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`);
          }
          if (numElements !== -1 && this.tensors.length !== numElements) {
              throw new Error(`Operation expected a list with ${numElements} elements but got a list with ${this.tensors.length} elements.`);
          }
          assertShapesMatchAllowUndefinedSize(elementShape, this.elementShape, 'TensorList shape mismatch: ');
          return tfc.tidy(() => {
              const reshapedTensors = this.tensors.map(tensor => tfc.reshape(tensor, elementShape));
              return tfc.stack(reshapedTensors, 0);
          });
      }
stack ( elementShape , elementDtype , numElements = - 1 ) { if ( elementDtype !== this . elementDtype ) { throw new Error ( ` ${ elementDtype } ${ this . elementDtype } ` ) ; } if ( numElements !== - 1 && this . tensors . length !== numElements ) { throw new Error ( ` ${ numElements } ${ this . tensors . length } ` ) ; } assertShapesMatchAllowUndefinedSize ( elementShape , this . elementShape , 'TensorList shape mismatch: ' ) ; return tfc . tidy ( ( ) => { const reshapedTensors = this . tensors . map ( tensor => tfc . reshape ( tensor , elementShape ) ) ; return tfc . stack ( reshapedTensors , 0 ) ; } ) ; }
Return a tensor that stacks a list of rank-R tf.Tensors into one rank-(R+1)
 tf.Tensor.
Return a tensor that stacks a list of rank - R tf . Tensors into one rank - ( R + 1 ) tf . Tensor .