From ffd783e272c9a2a3251b579ec7477378a1f851e1 Mon Sep 17 00:00:00 2001 From: Giacomo Lunghi Date: Mon, 30 Sep 2019 18:31:13 +0200 Subject: [PATCH] Added tf.split alias in tensorflow namespace --- src/TensorFlowNET.Core/APIs/tf.tensor.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/TensorFlowNET.Core/APIs/tf.tensor.cs b/src/TensorFlowNET.Core/APIs/tf.tensor.cs index 2052de93..8ba78f42 100644 --- a/src/TensorFlowNET.Core/APIs/tf.tensor.cs +++ b/src/TensorFlowNET.Core/APIs/tf.tensor.cs @@ -54,5 +54,23 @@ namespace Tensorflow new_axis_mask: new_axis_mask, shrink_axis_mask: shrink_axis_mask, name: name); + + /// + /// Splits a tensor into sub tensors. + /// + /// The Tensor to split. + /// Either an integer indicating the number of splits along split_dim or a 1-D integer + /// Tensor or Python list containing the sizes of each output tensor along split_dim. + /// If a scalar then it must evenly divide value.shape[axis]; otherwise the sum of sizes along the split dimension must match that of the value. + /// An integer or scalar int32 Tensor. The dimension along which to split. Must be in the range [-rank(value), rank(value)). Defaults to 0. + /// A name for the operation (optional) + /// if num_or_size_splits is a scalar returns num_or_size_splits Tensor objects; + /// if num_or_size_splits is a 1-D Tensor returns num_or_size_splits.get_shape[0] Tensor objects resulting from splitting value. + public Tensor[] split(Tensor value, int num_split, Tensor axis, string name = null) => gen_array_ops.split( + value: value, + axis: axis, + num_split: num_split, + name: name + ); } }