Ejemplo n.º 1
0
        public Embedding(EmbeddingArgs args)
            : base(args)
        {
            this.args = args;
            if (args.InputShape == null)
            {
                args.InputShape = args.InputLength;
            }

            embeddings_initializer = embeddings_initializer ?? tf.random_uniform_initializer;
            SupportsMasking        = mask_zero;
        }
Ejemplo n.º 2
0
        public Embedding(EmbeddingArgs args)
            : base(new LayerArgs // copy args
        {
            DType = args.DType,
            Name  = args.Name
        })
        {
            this.args = args;
            if (args.InputShape == null)
            {
                args.InputShape = args.InputLength;
            }

            embeddings_initializer = embeddings_initializer ?? tf.random_uniform_initializer;
            SupportsMasking        = mask_zero;
        }
Ejemplo n.º 3
0
        public Embedding(EmbeddingArgs args)
            : base(new LayerArgs // copy args
        {
            DType = args.DType,
            Name  = args.Name
        })
        {
            this.args = args;
            if (args.InputShape == null)
            {
                args.InputShape = args.InputLength;
            }

            if (args.BatchInputShape == null)
            {
                args.BatchInputShape = new int[] { args.BatchSize }
            }