Skip to content

Commit 9849829

Browse files
committed
convert_to_eager_tensor
1 parent 83151d2 commit 9849829

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/TensorFlowNET.Core/Tensors/Tensor.Value.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected NDArray GetNDArray(TF_DataType dtype)
5252
if (dtype == TF_DataType.TF_STRING)
5353
{
5454
var str= StringData();
55-
return new NDArray(str, new Shape(str.Length));
55+
return new NDArray(str, shape);
5656
}
5757

5858
return new NDArray(this);

src/TensorFlowNET.Core/Tensors/constant_op.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ value is NDArray nd &&
136136
return new EagerTensor(new[] { val }, Shape.Scalar);
137137
case double val:
138138
return new EagerTensor(new[] { val }, Shape.Scalar);
139+
case IEnumerable<Tensor> val:
140+
return ops.convert_to_tensor(val);
139141
case Array val:
140142
return new EagerTensor(val, val.GetShape());
141143
default:

0 commit comments

Comments
 (0)