read(index) {
          if (this.closed_) {
              throw new Error(`TensorArray ${this.name} has already been closed.`);
          }
          if (index < 0 || index >= this.size()) {
              throw new Error(`Tried to read from index ${index}, but array size is: ${this.size()}`);
          }
          const tensorWithState = this.tensors[index];
          if (tensorWithState.cleared) {
              throw new Error(`TensorArray ${this.name}: Could not read index ${index} twice because it was cleared after a previous read ` +
                  `(perhaps try setting clear_after_read = false?).`);
          }
          if (this.clearAfterRead) {
              tensorWithState.cleared = true;
          }
          tensorWithState.read = true;
          return tensorWithState.tensor;
      }
/**
       * Read the value at location index in the TensorArray.
       * @param index Number the index to read from.
       */
Read the value at location index in the TensorArray.
@param index Number the index to read from.
Read the value at location index in the TensorArray . @param index Number the index to read from .
read(index) {
          if (this.closed_) {
              throw new Error(`TensorArray ${this.name} has already been closed.`);
          }
          if (index < 0 || index >= this.size()) {
              throw new Error(`Tried to read from index ${index}, but array size is: ${this.size()}`);
          }
          const tensorWithState = this.tensors[index];
          if (tensorWithState.cleared) {
              throw new Error(`TensorArray ${this.name}: Could not read index ${index} twice because it was cleared after a previous read ` +
                  `(perhaps try setting clear_after_read = false?).`);
          }
          if (this.clearAfterRead) {
              tensorWithState.cleared = true;
          }
          tensorWithState.read = true;
          return tensorWithState.tensor;
      }
read ( index ) { if ( this . closed_ ) { throw new Error ( ` ${ this . name } ` ) ; } if ( index < 0 || index >= this . size ( ) ) { throw new Error ( ` ${ index } ${ this . size ( ) } ` ) ; } const tensorWithState = this . tensors [ index ] ; if ( tensorWithState . cleared ) { throw new Error ( ` ${ this . name } ${ index } ` + ` ` ) ; } if ( this . clearAfterRead ) { tensorWithState . cleared = true ; } tensorWithState . read = true ; return tensorWithState . tensor ; }
Read the value at location index in the TensorArray.
Read the value at location index in the TensorArray .