How to understand the term `tensor` in TensorFlow?

前端 未结 4 1688
温柔的废话
温柔的废话 2020-12-02 05:14

I am new to TensorFlow. While I am reading the existing documentation, I found the term tensor really confusing. Because of it, I need to clarify the following

4条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 05:53

    As already mentioned by others, yes they are all tensors.

    The way I understood those is to first visualize and understand 1D, 2D, 3D, 4D, 5D, and 6D tensors as in the picture below. (source: knoldus)

    Now, in the context of TensorFlow, you can imagine a computation graph like the one below,

    Here, the Ops take two tensors a and b as input; multiplies the tensors with itself and then adds the result of these multiplications to produce the result tensor t3. And these multiplications and addition Ops happen at the nodes in the computation graph.

    And these tensors a and b can be constant tensors, Variable tensors, or placeholders. It doesn't matter, as long as they are of the same data type and compatible shapes(or broadcastable to it) to achieve the operations.

提交回复
热议问题