Sha256: 2688aa5da3dba5efeb6d9769306f7a5a7a45d8c615c285d96a6f3d2178ac24f3
Contents?: true
Size: 846 Bytes
Versions: 9
Compression:
Stored size: 846 Bytes
Contents
module TensorStream class VariableScope attr_accessor :name, :reuse, :initializer attr_reader :used_names def initialize(name: nil, reuse: nil, initializer: nil) @name = name @reuse = reuse @initializer = initializer @used_names = [] end def get_variable(name, dtype: nil, shape: nil, initializer: nil, trainable: true, collections: nil, validate_shape: false) raise TensorStream::ValueError, "validate_shape=true and initializer does not have a defined shape" if validate_shape && !shape.nil && initializer.is_a?(Tensor) TensorStream::Variable.new(dtype || :float32, nil, shape, self, collections: collections, name: name, initializer: initializer, trainable: trainable) end def register_name(name) @used_names << name unless @used_names.include?(name) end end end
Version data entries
9 entries across 9 versions & 1 rubygems