shlogg · Early preview
Super Kai (Kazuya Ito) @superkai_kazuya

Understanding PyTorch's Mul() Function For Efficient Multiplication

mul() in PyTorch: element-wise multiplication of tensors/scalars with support for int, float, complex & bool data types.

Buy Me a Coffee☕
*Memos:

My post explains add().
My post explains sub().
My post explains div().
My post explains remainder().
My post explains fmod().

mul() can do multiplication with two of the 0D or more D tensors of zero or more elements or scalars or the 0D or more D tensor of zero or more elements and a scalar. getting the 0D or more D tensor of zero or more elements as shown below:
*Memos:

mul() can be used with torch or a tensor.
The 1st argument(input) with torch(Type:tensor or scalar of int, float, complex or bool) or using a tensor(Type:tensor of int, float, complex or bool)(Req...