Layer that performs element-wise addition on an Array of inputs.
It takes as input a list of tensors, all of the same shape, and returns a
single tensor (also of the same shape). The inputs are specified as an
Array when the apply method of the Add layer instance is called. For
example:
constinput1 = tf.input({shape: [2, 2]}); constinput2 = tf.input({shape: [2, 2]}); constaddLayer = tf.layers.add(); constsum = addLayer.apply([input1, input2]); console.log(JSON.stringify(sum.shape)); // You get [null, 2, 2], with the first dimension as the undetermined batch // dimension.
Layer that performs element-wise addition on an
Array
of inputs.It takes as input a list of tensors, all of the same shape, and returns a single tensor (also of the same shape). The inputs are specified as an
Array
when theapply
method of theAdd
layer instance is called. For example: