TensorFlowCheckpointReader

@available(*, deprecated, message: "TensorFlowCheckpointReader will be removed in S4TF v0.11. Please use CheckpointReader from swift-models\n(https://github.com/tensorflow/swift-models/blob/master/Support/Checkpoints/CheckpointReader.swift﹚\ninstead.")
public class TensorFlowCheckpointReader

A TensorFlow checkpoint file reader.

  • The path to the checkpoint file.

    Declaration

    public let checkpointPath: String
  • The number of tensors stored in the checkpoint.

    Declaration

    public var tensorCount: Int { get }
  • The names of the tensors stored in the checkpoint.

    Declaration

    public var tensorNames: [String] { get }
  • Creates a new TensorFlow checkpoint reader.

    • Arguments:
      • checkpointPath: Path to the checkpoint file.

    Declaration

    public init(checkpointPath: String)
  • Returns true if the checkpoint contains a tensor with the provided name.

    Declaration

    public func containsTensor(named name: String) -> Bool
  • Returns the shape of the tensor with the provided name stored in the checkpoint.

    Declaration

    public func shapeOfTensor(named name: String) -> TensorShape
  • Returns the scalar type of the tensor with the provided name stored in the checkpoint.

    Declaration

    public func scalarTypeOfTensor(named name: String) -> Any.Type
  • Loads and returns the value of the tensor with the provided name stored in the checkpoint.

    Declaration

    public func loadTensor<Scalar: _TensorFlowDataTypeCompatible>(
      named name: String
    ) -> ShapedArray<Scalar>