theano.sandbox.gpuarray.type
– Type classes¶
-
class
theano.sandbox.gpuarray.type.
GpuArrayConstant
(type, data, name=None)[source]¶ A constant representing a value on a certain GPU.
This supports all the operations that
TensorType
supports.See also
Constant
A variable representing a shared value on a certain GPU.
This supports all the operations that
TensorType
supports.See also
SharedVariable
-
class
theano.sandbox.gpuarray.type.
GpuArrayType
(dtype, broadcastable, context_name=None, name=None)[source]¶ The type that represents an array on a gpu.
The dtype indicates what scalar data type the elements of variables of this type will be.
broadcastable indicates whether each dimension is broadcastable or not (to be broadcastable a dimension must always be of length 1).
The context_name is the name of the context on will values of variables of this type will be stored.
Parameters: - dtype (str) – The name of a numpy dtype
- broadcastable (tuple of bools) – A tuple that indicates both the number of dimensions (by its length) and whether those dimensions are broadcastable or not (by the boolean values).
- context_name (str) – The name of the context the that this type is attached to (default: None, which is the context specified by config.device).
- name (string, optional) – A name for the type that will be used in printouts.
See also
-
Constant
[source]¶ alias of
GpuArrayConstant
alias of
GpuArraySharedVariable
-
Variable
[source]¶ alias of
GpuArrayVariable
-
context
[source]¶ The context object mapped to the type’s
context_name
. This is a property.
-
class
theano.sandbox.gpuarray.type.
GpuArrayVariable
(type, owner=None, index=None, name=None)[source]¶ A variable representing a computation on a certain GPU.
This supports all the operations that
TensorType
supports.See also
Variable
-
class
theano.sandbox.gpuarray.type.
GpuContextType
[source]¶ Minimal type used for passing contexts to nodes.
This Type is not a complete type and should never be used for regular graph operations.
-
theano.sandbox.gpuarray.type.
get_context
(name)[source]¶ Retrive the context associated with a name.
Return the context object mapped to ref that was previously register through
reg_context()
. Trying to get the context for an unregistered ref will raise a exception.Parameters: name (hashable object) – Name associated with the context we want (usually a string)
SharedVariable constructor for GpuArrayType.
See
theano.shared()
.
-
theano.sandbox.gpuarray.type.
list_contexts
()[source]¶ Return an iterable of all the registered context names.
-
theano.sandbox.gpuarray.type.
reg_context
(name, ctx)[source]¶ Register a context by mapping it to a name.
The context must be of type GpuContext and the name can be anything hashable (but is usually a string). Only one context can be registered per name and the second registration for a given name will raise an error.
Parameters: - name (hashable object) – Name to associate the context with (usually a string)
- ctx (GpuContext) – Context instance