tensor_to_scalar tensor to scalar. This layer changes input with size of 1 to rank 0 output (scalar).