[Tensorflow/Keras] 자주 쓰는 tf 함수들을 정리해보자 (작성중)
tf.gather : 슬라이싱 인덱스에 따라 params 축에서 슬라이스를 수집하는 함수이다. a라는 배열에서 t라는 인덱스의 값만을 추출하고자 할 때 사용한다. a = np.array([1,2,3,4,5]) t = np.array([0,2,4]) result = tf.gather(a,t) print(result) # tf.Tensor([1 3 5], shape=(3,), dtype=int64)