type Session = SessionT IO Source #
Building graphsclass Monad m => MonadBuild m where Source #
Lift a Build
action into a monad, including any explicit op renderings.
class Nodes t => Fetchable t a Source #
Types that tensor representations (e.g. Tensor
, ControlNode
) can be fetched into.
Includes collections of tensors (e.g. tuples).
Instances Instances details a ~ () => Fetchable ControlNode a Source # Instance detailsDefined in TensorFlow.Nodes
Fetchable t a => Fetchable [t] [a] Source # Instance detailsDefined in TensorFlow.Nodes
Fetchable t a => Fetchable (Maybe t) (Maybe a) Source # Instance detailsDefined in TensorFlow.Nodes
l ~ List ('[] :: [Type]) => Fetchable (ListOf f ('[] :: [Type])) l Source # Instance detailsDefined in TensorFlow.Nodes
(TensorType a, TensorDataType s a, a ~ a') => Fetchable (Tensor v a) (s a') Source # Instance detailsDefined in TensorFlow.Nodes
(TensorType a, a ~ a') => Fetchable (Tensor v a) (TensorData a') Source # Instance detailsDefined in TensorFlow.Nodes
(Fetchable t1 a1, Fetchable t2 a2) => Fetchable (t1, t2) (a1, a2) Source # Instance detailsDefined in TensorFlow.Nodes
(Fetchable (f t) a, Fetchable (ListOf f ts) (List as), i ~ Identity) => Fetchable (ListOf f (t ': ts)) (ListOf i (a ': as)) Source # Instance detailsDefined in TensorFlow.Nodes
(Fetchable t1 a1, Fetchable t2 a2, Fetchable t3 a3) => Fetchable (t1, t2, t3) (a1, a2, a3) Source # Instance detailsDefined in TensorFlow.Nodes
Types that contain ops which can be run.
run :: (MonadIO m, Fetchable t a) => t -> SessionT m a Source #
Run a subgraph t
, rendering any dependent nodes that aren't already rendered, and fetch the corresponding values for a
.
run_ :: (MonadIO m, Nodes t) => t -> SessionT m () Source #
Run a subgraph t
, rendering and extending any dependent nodes that aren't already rendered. This behaves like run
except that it doesn't do any fetches.
runWithFeeds :: (MonadIO m, Fetchable t a) => [Feed] -> t -> SessionT m a Source #
Run a subgraph t
, rendering any dependent nodes that aren't already rendered, feed the given input values, and fetch the corresponding result values for a
.
runWithFeeds_ :: (MonadIO m, Nodes t) => [Feed] -> t -> SessionT m () Source #
Run a subgraph t
, rendering any dependent nodes that aren't already rendered, feed the given input values, and fetch the corresponding result values for a
. This behaves like runWithFeeds
except that it doesn't do any fetches.
Starts a concurrent thread which evaluates the given Nodes forever until runSession exits or an exception occurs. Graph extension happens synchronously, but the resultant run proceeds as a separate thread.
BuildAn action for building nodes in a TensorFlow graph. Used to manage build state internally as part of the Session
monad.
render :: MonadBuild m => Tensor Build a -> m (Tensor Value a) Source #
Render a Tensor
, fixing its name, scope, device and control inputs from the MonadBuild
context. Also renders any dependencies of the Tensor
that weren't already rendered.
This operation is idempotent; calling render
on the same input in the same context will produce the same result. However, rendering the same Tensor Build
in two different contexts may result in two different Tensor Value
s.
addGraphDef :: MonadBuild m => GraphDef -> m () Source #
opName :: Lens' OpDef PendingNodeName Source #
opAttr :: Attribute a => Text -> Lens' OpDef a Source #
Tensordata ControlNode Source #
A type of graph node which has no outputs. These nodes are valuable for causing side effects when they are run.
Instances Instances detailsA named output of a TensorFlow operation.
The type parameter a
is the type of the elements in the Tensor
. The parameter v
is either:
Build
: An unrendered, immutable value.Value
: A rendered, immutable value.Ref
: A rendered stateful handle (e.g., a variable).Note that expr
, value
, render
and renderValue
can help convert between the different types of Tensor
.
expr :: TensorKind v => Tensor v a -> Tensor Build a Source #
Element typesclass TensorType a Source #
The class of scalar types supported by tensorflow.
Instances Instances detailsdata TensorData a Source #
Tensor data with the correct memory layout for tensorflow.
Instances Instances detailsclass TensorType a => TensorDataType s a where Source #
Types that can be converted to and from TensorData
.
Vector
is the most efficient to encode/decode for most element types.
type ResourceHandle = ResourceHandleProto Source #
Shape (dimensions) of a tensor.
TensorFlow supports shapes of unknown rank, which are represented as Nothing :: Maybe Shape
in Haskell.
type OneOf ts a = (TensorType a, TensorTypes' ts, NoneOf (AllTensorTypes \\ ts) a) Source #
A Constraint
specifying the possible choices of a TensorType
.
We implement a Constraint
like OneOf '[Double, Float] a
by turning the natural representation as a conjunction, i.e.,
a == Double || a == Float
into a disjunction like
a /= Int32 && a /= Int64 && a /= ByteString && ...
using an enumeration of all the possible TensorType
s.
type family a /= b :: Constraint where ... Source #
A constraint checking that two types are different.
Op combinatorscolocateWith :: (MonadBuild m, Rendered t) => t b -> m a -> m a Source #
Places all nodes rendered in the given Build
action on the same device as the given Tensor (see also withDevice
). Make sure that the action has side effects of rendering the desired tensors. A pure return would not have the desired effect.
A device that a node can be assigned to. There's a naming convention where the device names are constructed from job and replica names.
Instances Instances details Dependenciesgroup :: (MonadBuild m, Nodes t) => t -> m ControlNode Source #
Create an op that groups multiple operations.
When this op finishes, all ops in the input n
have finished. This op has no output.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4