我有以下代码:
using DiffSharp.Interop.Float64;
public class Layer
{
public DM W { get; set; }
public DV b { get; set; }
public Func<DV,DV> a { get; set; }
public DV Compute(DV v)
{
return a(W * v); // This Line
}
}
问题是我的声明W * v
,它说"Operator * cannot be applied to operands of type DM and DV"
。在 F# 中,它们以这种方式相乘。我们如何在 C# 中将这个矩阵和向量相乘?