Classes
The following classes are available globally.
-
A dynamic graph is a workspace for computations. All tensor variables can be tracked from a dynamic graph.
See moreDeclaration
Swift
public final class DynamicGraph
-
A model is a base class for stateful operations on a dynamic graph. It can be use to construct computations statically, thus, more efficient.
See moreDeclaration
Swift
public class Model
-
A model builder is a more generic type of model. A model can be quite static, thus, you have to be quite careful to have a model work with dynamic inputs. You cannot use reshape, or anything that can generate fixed tensor outputs from a fixed inputs.
A model builder on the other hand doesn’t have that restriction. When input changes, it simply calls the given builder closure to construct a new model. In such way, you can continue to use reshape etc to assume fixed inputs and outputs, it will just work for dynamic inputs. The newly built model will carry over stateful components (parameters) from the old models, thus, it doesn’t reset your training. This also means you need to make sure parameter shape won’t change when input changes, otherwise we will fatal.
See moreDeclaration
Swift
public final class ModelBuilder<T> : AnyModelBuilder
-
A type-erased model builder.
See moreDeclaration
Swift
public class AnyModelBuilder
-
A stream context is an object that an execution can be performed upon.
See moreDeclaration
Swift
public final class StreamContext
-
Declaration
Swift
public final class AnyTensorStorage