* Return a new Tensor with a callback function applied to each element. * @param {Function} callback - The function to apply to each element. It should take three arguments: * the current element, its index, and the tensor's data array. * @returns {Tensor}
(callback)
| 229 | * @returns {Tensor} A new Tensor with the callback function applied to each element. |
| 230 | */ |
| 231 | map(callback) { |
| 232 | return this.clone().map_(callback); |
| 233 | } |
| 234 | |
| 235 | /** |
| 236 | * Apply a callback function to each element of the tensor in place. |