TensorFlow.Tensor (original) (raw)
Documentation
data Tensor v a where Source #
A named output of a TensorFlow operation.
The type parameter a is the type of the elements in the [Tensor](TensorFlow-Tensor.html#t:Tensor "TensorFlow.Tensor"). The parameter v is either:
[Build](TensorFlow-Build.html#t:Build "TensorFlow.Build"): An unrendered, immutable value.[Value](TensorFlow-Tensor.html#t:Value "TensorFlow.Tensor"): A rendered, immutable value.[Ref](TensorFlow-Tensor.html#t:Ref "TensorFlow.Tensor"): A rendered stateful handle (e.g., a variable).
Note that [expr](TensorFlow-Tensor.html#v:expr "TensorFlow.Tensor"), [value](TensorFlow-Tensor.html#v:value "TensorFlow.Tensor"), [render](TensorFlow-Tensor.html#v:render "TensorFlow.Tensor") and [renderValue](TensorFlow-Tensor.html#v:renderValue "TensorFlow.Tensor") can help convert between the different types of [Tensor](TensorFlow-Tensor.html#t:Tensor "TensorFlow.Tensor").
class Rendered t where Source #
A class ensuring that a given tensor is rendered, i.e., has a fixed name, device, etc.
Instances
Instances details
colocateWith :: (MonadBuild m, Rendered t) => t b -> m a -> m a Source #
Places all nodes rendered in the given [Build](TensorFlow-Build.html#t:Build "TensorFlow.Build") action on the same device as the given Tensor (see also [withDevice](TensorFlow-Build.html#v:withDevice "TensorFlow.Build")). Make sure that the action has side effects of rendering the desired tensors. A pure return would not have the desired effect.
render :: MonadBuild m => Tensor Build a -> m (Tensor Value a) Source #
Render a [Tensor](TensorFlow-Tensor.html#t:Tensor "TensorFlow.Tensor"), fixing its name, scope, device and control inputs from the [MonadBuild](TensorFlow-Build.html#t:MonadBuild "TensorFlow.Build") context. Also renders any dependencies of the [Tensor](TensorFlow-Tensor.html#t:Tensor "TensorFlow.Tensor") that weren't already rendered.
This operation is idempotent; calling [render](TensorFlow-Tensor.html#v:render "TensorFlow.Tensor") on the same input in the same context will produce the same result. However, rendering the sameTensor Build in two different contexts may result in two differentTensor Values.
Records the given summary action in Build for retrieval with Summary protocol buffer in string form. For safety, use the pre-composed functions: Logging.scalarSummary and Logging.histogramSummary.