gather(indices, elementDtype, elementShape) {
          if (elementDtype !== this.elementDtype) {
              throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`);
          }
          assertShapesMatchAllowUndefinedSize(this.elementShape, elementShape, 'TensorList shape mismatch: ');
          // When indices is greater than the size of the list, indices beyond the
          // size of the list are ignored.
          indices = indices.slice(0, this.size());
          if (indices.length === 0) {
              return tfc.tensor([], [0].concat(this.elementShape));
          }
          return tfc.tidy(() => {
              const tensors = indices.map(i => tfc.reshape(this.tensors[i], elementShape));
              return tfc.stack(tensors, 0);
          });
      }
/**
       * Return selected values in the TensorList as a stacked Tensor. All of
       * selected values must have been written and their shapes must all match.
       * @param indices indices of tensors to gather
       * @param elementDtype output tensor dtype
       * @param elementShape output tensor element shape
       */
Return selected values in the TensorList as a stacked Tensor. All of
selected values must have been written and their shapes must all match.
@param indices indices of tensors to gather
@param elementDtype output tensor dtype
@param elementShape output tensor element shape
Return selected values in the TensorList as a stacked Tensor . All of selected values must have been written and their shapes must all match . @param indices indices of tensors to gather @param elementDtype output tensor dtype @param elementShape output tensor element shape
gather(indices, elementDtype, elementShape) {
          if (elementDtype !== this.elementDtype) {
              throw new Error(`Invalid data types; op elements ${elementDtype}, but list elements ${this.elementDtype}`);
          }
          assertShapesMatchAllowUndefinedSize(this.elementShape, elementShape, 'TensorList shape mismatch: ');
          indices = indices.slice(0, this.size());
          if (indices.length === 0) {
              return tfc.tensor([], [0].concat(this.elementShape));
          }
          return tfc.tidy(() => {
              const tensors = indices.map(i => tfc.reshape(this.tensors[i], elementShape));
              return tfc.stack(tensors, 0);
          });
      }
gather ( indices , elementDtype , elementShape ) { if ( elementDtype !== this . elementDtype ) { throw new Error ( ` ${ elementDtype } ${ this . elementDtype } ` ) ; } assertShapesMatchAllowUndefinedSize ( this . elementShape , elementShape , 'TensorList shape mismatch: ' ) ; indices = indices . slice ( 0 , this . size ( ) ) ; if ( indices . length === 0 ) { return tfc . tensor ( [ ] , [ 0 ] . concat ( this . elementShape ) ) ; } return tfc . tidy ( ( ) => { const tensors = indices . map ( i => tfc . reshape ( this . tensors [ i ] , elementShape ) ) ; return tfc . stack ( tensors , 0 ) ; } ) ; }
Return selected values in the TensorList as a stacked Tensor.
Return selected values in the TensorList as a stacked Tensor .
// When indices is greater than the size of the list, indices beyond the // size of the list are ignored.