Class/Object

org.platanios.tensorflow.api.ops.training.distribute.values

PerDeviceVariable

Related Docs: object PerDeviceVariable | package values

Permalink

class PerDeviceVariable extends PerDeviceValue[variables.Variable] with DistributedVariable

Holds a map from devices to variables whose values are reduced on save.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PerDeviceVariable
  2. DistributedVariable
  3. Serializable
  4. PerDeviceValue
  5. DistributedValue
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PerDeviceVariable(primaryVariable: variables.Variable, index: Map[DeviceSpecification, variables.Variable], reduction: Reduction)

    Permalink

    primaryVariable

    Primary variable.

    index

    Index map from devices to variables.

    reduction

    Reduction to use when saving the variables.

    Attributes
    protected

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def assign(value: Output, name: String = "Assign")(implicit context: DistributionContext): Output

    Permalink

    Creates an op that assigns the provided value to this variable and returns its value.

    Creates an op that assigns the provided value to this variable and returns its value.

    value

    Value to assign the variable to.

    name

    Name for created op.

    returns

    Variable value read op, after the assignment.

    Annotations
    @throws( ... )
  6. def assignAdd(value: Output, name: String = "AssignAdd")(implicit context: DistributionContext): Output

    Permalink

    Creates an op that adds the provided value to the current value of the variable and returns its value.

    Creates an op that adds the provided value to the current value of the variable and returns its value.

    value

    Value to add to the current variable value.

    name

    Name for created op.

    returns

    Variable value read op, after the addition.

    Annotations
    @throws( ... ) @throws( ... )
  7. def assignScatter(indices: Output, values: Output, name: String = "AssignScatter")(implicit context: DistributionContext): Output

    Permalink

    Creates an op that applies updates the provided sparse value updates to this variable and returns its value.

    Creates an op that applies updates the provided sparse value updates to this variable and returns its value.

    indices

    Indices corresponding to the values used for the update.

    values

    Values to use for updating, corresponding to the provided indices.

    name

    Name for created op.

    returns

    Variable value read op, after the addition.

    Annotations
    @throws( ... ) @throws( ... )
  8. def assignScatterAdd(indices: Output, values: Output, name: String = "AssignScatterAdd")(implicit context: DistributionContext): Output

    Permalink

    Creates an op that adds the provided sparse value to the current value of the variable and returns its value.

    Creates an op that adds the provided sparse value to the current value of the variable and returns its value.

    indices

    Indices corresponding to the values being added.

    values

    Values to be added, corresponding to the provided indices.

    name

    Name for created op.

    returns

    Variable value read op, after the addition.

    Annotations
    @throws( ... ) @throws( ... )
  9. def assignScatterSub(indices: Output, values: Output, name: String = "AssignScatterSub")(implicit context: DistributionContext): Output

    Permalink

    Creates an op that subtracts the provided sparse value from the current value of the variable and returns its value.

    Creates an op that subtracts the provided sparse value from the current value of the variable and returns its value.

    indices

    Indices corresponding to the values being subtracted.

    values

    Values to be subtracted, corresponding to the provided indices.

    name

    Name for created op.

    returns

    Variable value read op, after the subtraction.

    Annotations
    @throws( ... ) @throws( ... )
  10. def assignSub(value: Output, name: String = "AssignAdd")(implicit context: DistributionContext): Output

    Permalink

    Creates an op that subtracts the provided value from the current value of the variable and returns its value.

    Creates an op that subtracts the provided value from the current value of the variable and returns its value.

    value

    Value to subtract from the current variable value.

    name

    Name for created op.

    returns

    Variable value read op, after the subtraction.

    Annotations
    @throws( ... ) @throws( ... )
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. val dataType: types.DataType

    Permalink

    Data type of this variable.

    Data type of this variable.

    Definition Classes
    DistributedVariable
  13. def devices: Seq[DeviceSpecification]

    Permalink

    Returns the devices on which this value is distributed.

    Returns the devices on which this value is distributed.

    Definition Classes
    DistributedValue
  14. val distributionType: Type

    Permalink

    Type of this distributed value (e.g., per-device or mirrored).

    Type of this distributed value (e.g., per-device or mirrored).

    Definition Classes
    DistributedValue
  15. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  17. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def gather(indices: Output, name: String = "Gather")(implicit context: DistributionContext): Output

    Permalink

    Creates an op that reads the value of this variable sparsely, using the provided indices.

    Creates an op that reads the value of this variable sparsely, using the provided indices.

    This method should be used when there are multiple reads, or when it is desirable to read the value only after some condition is true.

    indices

    Indices to use for the sparse read.

    name

    Name for the created op.

    returns

    Created op.

    Definition Classes
    DistributedVariable
    Annotations
    @throws( ... )
  19. def get(device: String = "current")(implicit context: DistributionContext): variables.Variable

    Permalink

    Returns the value on the specified device (defaults to the current device, if not provided.

    Returns the value on the specified device (defaults to the current device, if not provided.

    Definition Classes
    DistributedValue
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. val graph: core.Graph

    Permalink

    Graph where this variable is defined.

    Graph where this variable is defined.

    Definition Classes
    DistributedVariable
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. val index: Map[DeviceSpecification, variables.Variable]

    Permalink

    Index map from devices to variables.

    Index map from devices to variables.

    Definition Classes
    PerDeviceVariableDistributedVariablePerDeviceValueDistributedValue
  24. def initializedValue(implicit context: DistributionContext): Output

    Permalink

    Value of the initialized variable.

    Value of the initialized variable. You should use this instead of the variable itself to initialize another variable with a value that depends on the value of this variable.

    Example:

    // Initialize `v` with random values, and then use `initializedValue` to guarantee that `v` has been initialized
    // before its value is used to initialize `w`. The random tensor will only be sampled once.
    val v = tf.variable("v", FLOAT32, Shape(10, 40), tf.RandomTruncatedNormalInitializer())
    val w = tf.variable("w", initializer = tf.ConstantInitializer(v.initializedValue * 2.0))
    Definition Classes
    DistributedVariable
  25. val initializer: Op

    Permalink

    Returns the initializer for this variable.

    Returns the initializer for this variable.

    Definition Classes
    DistributedVariable
  26. val isInitialized: Output

    Permalink

    Op output that is true when the variable has been initialized and false otherwise.

    Op output that is true when the variable has been initialized and false otherwise.

    Definition Classes
    DistributedVariable
  27. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  28. val name: String

    Permalink

    Name of this variable.

    Name of this variable.

    Definition Classes
    DistributedVariable
  29. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. def onDevice(device: String): Boolean

    Permalink

    Returns true if the values are distributed on the provided device.

    Returns true if the values are distributed on the provided device.

    Definition Classes
    DistributedValue
  33. def op(implicit context: DistributionContext): Op

    Permalink

    Returns the op of this variable.

    Returns the op of this variable.

    Definition Classes
    DistributedVariable
  34. val primaryVariable: variables.Variable

    Permalink

    Primary variable.

    Primary variable.

    Definition Classes
    PerDeviceVariableDistributedVariable
  35. def read(name: String = "Read")(implicit context: DistributionContext): Output

    Permalink

    Creates an op that reads the value of this variable.

    Creates an op that reads the value of this variable.

    This method should be used when there are multiple reads, or when it is desirable to read the value only after some condition is true.

    The returned value may be different from that of value depending on the device being used, the control dependencies, etc.

    returns

    Created op.

    Definition Classes
    DistributedVariable
  36. val reduction: Reduction

    Permalink

    Reduction to use when saving the variables.

  37. val shape: core.Shape

    Permalink

    Shape of this variable.

    Shape of this variable.

    Definition Classes
    DistributedVariable
  38. val sharedName: String

    Permalink
    Attributes
    protected
    Definition Classes
    DistributedVariable
  39. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  40. def toProto(exportScope: String): VariableDef

    Permalink

    Alias for toVariableDef.

    Alias for toVariableDef.

    Definition Classes
    DistributedVariable
  41. def toProto: VariableDef

    Permalink

    Converts this object to its corresponding ProtoBuf object.

    Converts this object to its corresponding ProtoBuf object.

    returns

    ProtoBuf object corresponding to this object.

    Definition Classes
    DistributedVariableSerializable
  42. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  43. def toVariableDef(exportScope: String): VariableDef

    Permalink

    Convert this object to its corresponding ProtoBuf object.

    Convert this object to its corresponding ProtoBuf object.

    exportScope

    Optional string specifying the name scope to remove. Only the ops within this name scope will be included in the resulting ProtoBuf object and the export scope will be stripped from their names to allow for easy import into new name scopes.

    returns

    ProtoBuf object corresponding to this object.

    Definition Classes
    DistributedVariable
  44. def value(implicit context: DistributionContext): Output

    Permalink

    Returns a cached op which reads the last value of this partitioned variable.

    Returns a cached op which reads the last value of this partitioned variable.

    You can not assign a new value to the returned tensor as it is not a reference to the variable.

    The returned op output will not inherit the control dependencies from the scope where the value is used, which is equivalent behavior to that of getting the value of a variable.

    NOTE: You usually do not need to call this method directly, as all ops that use variables do so by internally converting them to tensors.

    Definition Classes
    DistributedVariable
  45. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from DistributedVariable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped