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. gfg, geeks = tf.split(x, num_or_size_splits=2, axis=0);
  7.  
  8. print(gfg);
  9. print(geeks);
Success #stdin #stdout 1.43s 196836KB
stdin
Standard input is empty
stdout
Tensor("split:0", shape=(4,), dtype=int32)
Tensor("split:1", shape=(4,), dtype=int32)