You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The creation of a cursor on a dataview with sparse vectors does not work anymore.
Expected getter type is VBuffer, produced getter type is VBuffer<VBuffer>.
Source code / logs
The following code fails.
class ExampleASparse
{
[VectorType(5)]
public VBuffer X;
}
[Fact]
[TestCategory(Cat)]
public void SparseDataView()
{
var inputs = new[] {
new ExampleASparse() { X = new VBuffer<float> (5, 3, new float[] { 1, 10, 100 }, new int[] { 0, 2, 4 }) },
new ExampleASparse() { X = new VBuffer<float> (5, 3, new float[] { 2, 3, 5 }, new int[] { 0, 1, 3 }) }
};
var host = new TlcEnvironment();
var data = host.CreateStreamingDataView(inputs);
VBuffer<float> value = new VBuffer<float>();
int n = 0;
using (var cur = data.GetRowCursor(i => true)) // it fails here
{
var getter = cur.GetGetter<VBuffer<float>>(0);
while (cur.MoveNext())
{
getter(ref value);
Assert.True(value.Count == 3);
++n;
}
}
Assert.True(n == 2);
Done();
}
The text was updated successfully, but these errors were encountered:
xadupre
pushed a commit
to xadupre/machinelearning
that referenced
this issue
Jul 27, 2018
System information
Issue
Source code / logs
The following code fails.
class ExampleASparse
{
[VectorType(5)]
public VBuffer X;
}
The text was updated successfully, but these errors were encountered: