Browse Source

Merge pull request #408 from Jamaslab/add-tfsplit-alias-in-tensorflow-namespace

Added tf.split alias in tensorflow namespace
tags/v0.12
Haiping Chen GitHub 6 years ago
parent
commit
c7993cd5af
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 0 deletions
  1. +18
    -0
      src/TensorFlowNET.Core/APIs/tf.tensor.cs

+ 18
- 0
src/TensorFlowNET.Core/APIs/tf.tensor.cs View File

@@ -54,5 +54,23 @@ namespace Tensorflow
new_axis_mask: new_axis_mask, new_axis_mask: new_axis_mask,
shrink_axis_mask: shrink_axis_mask, shrink_axis_mask: shrink_axis_mask,
name: name); name: name);

/// <summary>
/// Splits a tensor into sub tensors.
/// </summary>
/// <param name="value">The Tensor to split.</param>
/// <param name="num_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.</param>
/// <param name="axis">An integer or scalar int32 Tensor. The dimension along which to split. Must be in the range [-rank(value), rank(value)). Defaults to 0.</param>
/// <param name="name">A name for the operation (optional)</param>
/// <returns>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.</returns>
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
);
} }
} }

Loading…
Cancel
Save