Exemplo n.º 1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Variable"/> class.
 /// </summary>
 /// <param name="expression">The expression.</param>
 public Variable(VariableExpression expression)
 {
     this.expression = expression;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BinaryTensorScalarExpression"/> class.
 /// </summary>
 /// <param name="left">The left.</param>
 /// <param name="right">The right.</param>
 /// <param name="evaluate">The evaluate.</param>
 public BinaryTensorScalarExpression(VariableExpression left, ScalarExpression right, Func <NDArray, NDArray, float, NDArray> evaluate)
 {
     this.left     = left;
     this.right    = right;
     this.evaluate = evaluate;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ViewExpression"/> class.
 /// </summary>
 /// <param name="src">The source.</param>
 /// <param name="evaluate">The evaluate.</param>
 public ViewExpression(VariableExpression src, Func <NDArray, NDArray> evaluate)
     : base(src.IsValidLvalue)
 {
     this.src      = src;
     this.evaluate = evaluate;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="UnaryTensorExpression"/> class.
 /// </summary>
 /// <param name="src">The source.</param>
 /// <param name="evaluate">The evaluate.</param>
 public UnaryTensorExpression(VariableExpression src, Func <NDArray, NDArray, NDArray> evaluate)
 {
     this.src      = src;
     this.evaluate = evaluate;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AddmmExpression"/> class.
 /// </summary>
 /// <param name="beta">The beta.</param>
 /// <param name="src">The source.</param>
 /// <param name="alpha">The alpha.</param>
 /// <param name="m1">The m1.</param>
 /// <param name="m2">The m2.</param>
 public AddmmExpression(float beta, VariableExpression src, float alpha, VariableExpression m1, VariableExpression m2)
 {
     this.beta  = beta;
     this.src   = src;
     this.alpha = alpha;
     this.m1    = m1;
     this.m2    = m2;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ScatterFillExpression"/> class.
 /// </summary>
 /// <param name="src">The source.</param>
 /// <param name="value">The value.</param>
 /// <param name="dimension">The dimension.</param>
 /// <param name="indices">The indices.</param>
 public ScatterFillExpression(VariableExpression src, ScalarVar value, int dimension, VariableExpression indices)
 {
     this.src       = src;
     this.value     = value;
     this.dimension = dimension;
     this.indices   = indices;
 }
Exemplo n.º 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ToDeviceExpression"/> class.
 /// </summary>
 /// <param name="src">The source.</param>
 /// <param name="allocator">The allocator.</param>
 public ToDeviceExpression(VariableExpression src, IAllocator allocator)
 {
     this.src       = src;
     this.allocator = allocator;
 }
Exemplo n.º 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AsTypeExpression"/> class.
 /// </summary>
 /// <param name="src">The source.</param>
 /// <param name="type">The type.</param>
 public AsTypeExpression(VariableExpression src, DType type)
 {
     this.src  = src;
     this.type = type;
 }