Class: TensorStream::VariableScope
- Inherits:
-
Object
- Object
- TensorStream::VariableScope
- Defined in:
- lib/tensor_stream/variable_scope.rb
Instance Attribute Summary collapse
-
#initializer ⇒ Object
Returns the value of attribute initializer.
-
#name ⇒ Object
Returns the value of attribute name.
-
#reuse ⇒ Object
Returns the value of attribute reuse.
Instance Method Summary collapse
- #get_variable(name, dtype: nil, shape: nil, initializer: nil, trainable: true, collections: nil) ⇒ Object
-
#initialize(name: '', reuse: nil, initializer: nil) ⇒ VariableScope
constructor
A new instance of VariableScope.
Constructor Details
#initialize(name: '', reuse: nil, initializer: nil) ⇒ VariableScope
Returns a new instance of VariableScope.
5 6 7 8 9 |
# File 'lib/tensor_stream/variable_scope.rb', line 5 def initialize(name: '', reuse: nil, initializer: nil) @name = name @reuse = reuse @initializer = initializer end |
Instance Attribute Details
#initializer ⇒ Object
Returns the value of attribute initializer.
3 4 5 |
# File 'lib/tensor_stream/variable_scope.rb', line 3 def initializer @initializer end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/tensor_stream/variable_scope.rb', line 3 def name @name end |
#reuse ⇒ Object
Returns the value of attribute reuse.
3 4 5 |
# File 'lib/tensor_stream/variable_scope.rb', line 3 def reuse @reuse end |
Instance Method Details
#get_variable(name, dtype: nil, shape: nil, initializer: nil, trainable: true, collections: nil) ⇒ Object
11 12 13 |
# File 'lib/tensor_stream/variable_scope.rb', line 11 def get_variable(name, dtype: nil, shape: nil, initializer: nil, trainable: true, collections: nil) TensorStream::Variable.new(dtype || :float32, nil, shape, self, collections: collections, name: name, initializer: initializer, trainable: trainable) end |