Class: TensorStream::VariableScope

Inherits:
Object
  • Object
show all
Defined in:
lib/tensor_stream/variable_scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#initializerObject

Returns the value of attribute initializer.



3
4
5
# File 'lib/tensor_stream/variable_scope.rb', line 3

def initializer
  @initializer
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/tensor_stream/variable_scope.rb', line 3

def name
  @name
end

#reuseObject

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