tf.random.uniform
-
Tensorflow에서 사용하는 데이터 배열 Tensor 사용하기(constant, Variable)Data Science/Tensorflow 2022. 10. 24. 22:12
Numpy에서 Numpy.array를 사용하듯이 Tensorflow에서는 tensor를 사용한다. 본 포스팅에서는 Tensor란 무엇이고, Tensor를 어떻게 다룰수 있는지 알아본다. 1. Tensorflow.constant contant tensor는 생성후 값의 수정이 불가능한 Tensor이다. 1.1 Constant tensor 생성 tensor = tf.constant([1,2,3,4,5]) 생성되는 tensor의 데이터 타입을 지정해줄 수도 있다. tensor = tf.constant([1,2,3], dtype='float32') 1.2 Constant tensor 정보 확인 생성된 tensor로부터 아래의 정보를 얻을수 있다. tensor = tf.constant([1,2,3,4,5]) pr..