fork download
  1. import tensorflow as tf
  2. import numpy as np
  3.  
  4. x = [10, 20, 50, 60, 30, 40, 70, 80];
  5.  
  6.  
  7. gfg, geeks = tf.split(x, num_or_size_splits=2, axis=-1);
  8.  
  9. print(gfg);
  10.  
  11. print(geeks);
Success #stdin #stdout 1.14s 197844KB
stdin
Standard input is empty
stdout
Tensor("split:0", shape=(4,), dtype=int32)
Tensor("split:1", shape=(4,), dtype=int32)