| @@ -0,0 +1,15 @@ | |||||
| using NumSharp; | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow | |||||
| { | |||||
| public partial class Tensor | |||||
| { | |||||
| public object[] Flatten() | |||||
| { | |||||
| return new Tensor[] { this }; | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -39,7 +39,12 @@ namespace Tensorflow | |||||
| /// Internally, TensorFlow represents tensors as n-dimensional arrays of base datatypes. | /// Internally, TensorFlow represents tensors as n-dimensional arrays of base datatypes. | ||||
| /// </summary> | /// </summary> | ||||
| [SuppressMessage("ReSharper", "ConvertToAutoProperty")] | [SuppressMessage("ReSharper", "ConvertToAutoProperty")] | ||||
| public partial class Tensor : DisposableObject, ITensorOrOperation, _TensorLike, ITensorOrTensorArray, IPackable<Tensor> | |||||
| public partial class Tensor : DisposableObject, | |||||
| ITensorOrOperation, | |||||
| _TensorLike, | |||||
| ITensorOrTensorArray, | |||||
| IPackable<Tensor>, | |||||
| ICanBeFlattened | |||||
| { | { | ||||
| private readonly int _id; | private readonly int _id; | ||||
| private readonly Operation _op; | private readonly Operation _op; | ||||
| @@ -61,5 +61,11 @@ namespace Tensorflow | |||||
| public Tensor read(Tensor index, string name = null) | public Tensor read(Tensor index, string name = null) | ||||
| => _implementation.read(index, name: name); | => _implementation.read(index, name: name); | ||||
| public TensorArray write(Tensor index, Tensor value, string name = null) | |||||
| => _implementation.write(index, value, name: name); | |||||
| public Tensor stack(string name = null) | |||||
| => _implementation.stack(name: name); | |||||
| } | } | ||||
| } | } | ||||
| @@ -33,6 +33,9 @@ namespace Tensorflow | |||||
| public static TF_DataType float32 = TF_DataType.TF_FLOAT; // is that float32? | public static TF_DataType float32 = TF_DataType.TF_FLOAT; // is that float32? | ||||
| public static TF_DataType float16 = TF_DataType.TF_HALF; | public static TF_DataType float16 = TF_DataType.TF_HALF; | ||||
| public static TF_DataType float64 = TF_DataType.TF_DOUBLE; | public static TF_DataType float64 = TF_DataType.TF_DOUBLE; | ||||
| public static TF_DataType complex = TF_DataType.TF_COMPLEX; | |||||
| public static TF_DataType complex64 = TF_DataType.TF_COMPLEX64; | |||||
| public static TF_DataType complex128 = TF_DataType.TF_COMPLEX128; | |||||
| public static TF_DataType variant = TF_DataType.TF_VARIANT; | public static TF_DataType variant = TF_DataType.TF_VARIANT; | ||||
| public static TF_DataType resource = TF_DataType.TF_RESOURCE; | public static TF_DataType resource = TF_DataType.TF_RESOURCE; | ||||