Sha256: 2c35a9303d72b3409746fb9c39c4850ba7f61a2d3921046491351b7cfcd8ecdc

Contents?: true

Size: 679 Bytes

Versions: 1

Compression:

Stored size: 679 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)
      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

1 entries across 1 versions & 1 rubygems

Version Path
tensor_stream-0.8.1 lib/tensor_stream/variable_scope.rb