Skip to content

Frame 105:25 (plane function) #11

Answered by themetaschemer
Solaxun asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @Solaxun. Great questions, both.
For the first, since plane is defined with extended operators, it can operate on tensor2's. It will produce a tensor1 as a result (instead of a scalar). We make use of this property throughout the book.

The second question is also a very good one and has a somewhat subtle answer.

In general, when you try to add two tensors of the same tlen, for example:

(+ (tensor A0 B0 C0) (tensor A1 B1 C1))

We expect the result to be:

(tensor (+ A0 A1) (+ B0 B1) (+ C0 C1))

Now, if A0, B0, and C0 are tensor0 (i.e., scalars) and A1, B1, and C1 are tensors1, (as they are in your example), you will get the result that you got, which is [[10 9 14] [16 13 16] [6 10 9]]

Th…

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Solaxun
Comment options

Answer selected by Solaxun
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants