summaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/tensor/functions/Argmax.java
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-11-30 10:04:50 +0100
committerHenning Baldersheim <balder@yahoo-inc.com>2022-11-30 10:04:50 +0100
commit448231f18ba53edf5c0e7ab4b6732ef69328281c (patch)
tree289f528fd6adac2a39e636c449c633c26fdb838e /vespajlib/src/main/java/com/yahoo/tensor/functions/Argmax.java
parent711362f17d4bbece0dc2d0833a22063374ae3e04 (diff)
Reduce the simple usage of guava where java has caught up
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/tensor/functions/Argmax.java')
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/functions/Argmax.java10
1 files changed, 4 insertions, 6 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/functions/Argmax.java b/vespajlib/src/main/java/com/yahoo/tensor/functions/Argmax.java
index d2762ad762d..2ee3d7dab60 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/functions/Argmax.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/functions/Argmax.java
@@ -1,10 +1,8 @@
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.tensor.functions;
-import com.google.common.collect.ImmutableList;
import com.yahoo.tensor.evaluation.Name;
-import java.util.Collections;
import java.util.List;
import java.util.Objects;
@@ -17,21 +15,21 @@ public class Argmax<NAMETYPE extends Name> extends CompositeTensorFunction<NAMET
private final List<String> dimensions;
public Argmax(TensorFunction<NAMETYPE> argument) {
- this(argument, Collections.emptyList());
+ this(argument, List.of());
}
public Argmax(TensorFunction<NAMETYPE> argument, String dimension) {
- this(argument, Collections.singletonList(dimension));
+ this(argument, List.of(dimension));
}
public Argmax(TensorFunction<NAMETYPE> argument, List<String> dimensions) {
Objects.requireNonNull(dimensions, "The dimensions cannot be null");
this.argument = argument;
- this.dimensions = ImmutableList.copyOf(dimensions);
+ this.dimensions = List.copyOf(dimensions);
}
@Override
- public List<TensorFunction<NAMETYPE>> arguments() { return Collections.singletonList(argument); }
+ public List<TensorFunction<NAMETYPE>> arguments() { return List.of(argument); }
@Override
public TensorFunction<NAMETYPE> withArguments(List<TensorFunction<NAMETYPE>> arguments) {