TensorFlow Operations - W3Schools
www.w3schools.com › ai › ai_tensorflow_operationsYou can add two tensors using tensorA.add (tensorB): Example. const tensorA = tf.tensor( [ [1, 2], [3, 4], [5, 6]]); const tensorB = tf.tensor( [ [1,-1], [2,-2], [3,-3]]); // Tensor Addition. const tensorNew = tensorA.add(tensorB); // Result: [ [2, 1], [5, 2], [8, 3] ] Try it Yourself ».
Tensors and operations | TensorFlow.js
www.tensorflow.org › js › guideAug 22, 2020 · While tensors allow you to store data, operations (ops) allow you to manipulate that data. TensorFlow.js also provides a wide variety of ops suitable for linear algebra and machine learning that can be performed on tensors. Example: computing x 2 of all elements in a tf.Tensor: const x = tf.tensor( [1, 2, 3, 4]);
Tensors and operations - TensorFlow for R
https://tensorflow.rstudio.com/.../customization/tensors-operationsTensorFlow offers a rich library of operations ( tf$add, tf$matmul, tf$linalg$inv etc.) that consume and produce tf.Tensors. These operations automatically convert native R types, for example: tf $add ( 1, 2) ## tf.Tensor (3.0, shape= (), dtype=float32) tf $add ( c ( 1, 2 ), c ( 3, 4 )) ## tf.Tensor ( [4. 6.], shape= (2,), dtype=float32)