function fromTensor(tensor, elementShape, elementDtype) {
      const dtype = tensor.dtype;
      if (tensor.shape.length < 1) {
          throw new Error(`Tensor must be at least a vector, but saw shape: ${tensor.shape}`);
      }
      if (tensor.dtype !== elementDtype) {
          throw new Error(`Invalid data types; op elements ${tensor.dtype}, but list elements ${elementDtype}`);
      }
      const outputShape = tensor.shape.slice(1);
      assertShapesMatchAllowUndefinedSize(outputShape, elementShape, 'TensorList shape mismatch: ');
      const tensorList = tfc.unstack(tensor);
      return new TensorList(tensorList, elementShape, dtype);
  }
/**
   * Creates a TensorList which, when stacked, has the value of tensor.
   * @param tensor from tensor
   * @param elementShape output tensor element shape
   */
Creates a TensorList which, when stacked, has the value of tensor.
@param tensor from tensor
@param elementShape output tensor element shape
Creates a TensorList which when stacked has the value of tensor . @param tensor from tensor @param elementShape output tensor element shape
function fromTensor(tensor, elementShape, elementDtype) {
      const dtype = tensor.dtype;
      if (tensor.shape.length < 1) {
          throw new Error(`Tensor must be at least a vector, but saw shape: ${tensor.shape}`);
      }
      if (tensor.dtype !== elementDtype) {
          throw new Error(`Invalid data types; op elements ${tensor.dtype}, but list elements ${elementDtype}`);
      }
      const outputShape = tensor.shape.slice(1);
      assertShapesMatchAllowUndefinedSize(outputShape, elementShape, 'TensorList shape mismatch: ');
      const tensorList = tfc.unstack(tensor);
      return new TensorList(tensorList, elementShape, dtype);
  }
function fromTensor ( tensor , elementShape , elementDtype ) { const dtype = tensor . dtype ; if ( tensor . shape . length < 1 ) { throw new Error ( ` ${ tensor . shape } ` ) ; } if ( tensor . dtype !== elementDtype ) { throw new Error ( ` ${ tensor . dtype } ${ elementDtype } ` ) ; } const outputShape = tensor . shape . slice ( 1 ) ; assertShapesMatchAllowUndefinedSize ( outputShape , elementShape , 'TensorList shape mismatch: ' ) ; const tensorList = tfc . unstack ( tensor ) ; return new TensorList ( tensorList , elementShape , dtype ) ; }
Creates a TensorList which, when stacked, has the value of tensor.
Creates a TensorList which when stacked has the value of tensor .