fork download
  1. import tensorflow as tf
  2. import numpy as np
  3. import sys
  4. print(sys.version)
  5.  
  6. x = [10, 20, 50, 60, 30, 40, 70, 80];
  7.  
  8. gfg, geeks = tf.split(x, num_or_size_splits=2, axis=0);
  9.  
  10. print(gfg);
  11. print gfg.shape;
  12. print geeks;
  13.  
  14.  
Success #stdin #stdout 1.09s 198108KB
stdin
Standard input is empty
stdout
2.7.16 (default, Apr  6 2019, 01:42:57) 
[GCC 8.3.0]
Tensor("split:0", shape=(4,), dtype=int32)
(4,)
Tensor("split:1", shape=(4,), dtype=int32)