diff options
author | Martin Polden <mpolden@mpolden.no> | 2023-01-26 14:42:15 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2023-01-26 14:42:15 +0100 |
commit | 3d4f199ed58cce65680c775df824ae376e518a23 (patch) | |
tree | ba5cb7bc03ccbdbc0cdc724f63c031c2683df309 /config-model/src/main/java/com/yahoo/schema/OnnxModel.java | |
parent | ed5d394998b5538e2a3330409391ab18acadb1df (diff) |
Remove 'required' attribute
Diffstat (limited to 'config-model/src/main/java/com/yahoo/schema/OnnxModel.java')
-rw-r--r-- | config-model/src/main/java/com/yahoo/schema/OnnxModel.java | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/config-model/src/main/java/com/yahoo/schema/OnnxModel.java b/config-model/src/main/java/com/yahoo/schema/OnnxModel.java index ae6f1fd96e4..3d96849fa15 100644 --- a/config-model/src/main/java/com/yahoo/schema/OnnxModel.java +++ b/config-model/src/main/java/com/yahoo/schema/OnnxModel.java @@ -24,7 +24,7 @@ public class OnnxModel extends DistributableResource { private String statelessExecutionMode = null; private Integer statelessInterOpThreads = null; private Integer statelessIntraOpThreads = null; - private GpuDevice gpuDevice = null; + private Integer gpuDevice = null; public OnnxModel(String name) { super(name); @@ -114,9 +114,9 @@ public class OnnxModel extends DistributableResource { } } - public void setGpuDevice(int deviceNumber, boolean required) { + public void setGpuDevice(int deviceNumber) { if (deviceNumber >= 0) { - this.gpuDevice = new GpuDevice(deviceNumber, required); + this.gpuDevice = deviceNumber; } } @@ -124,16 +124,8 @@ public class OnnxModel extends DistributableResource { return Optional.ofNullable(statelessIntraOpThreads); } - public Optional<GpuDevice> getGpuDevice() { + public Optional<Integer> getGpuDevice() { return Optional.ofNullable(gpuDevice); } - public record GpuDevice(int deviceNumber, boolean required) { - - public GpuDevice { - if (deviceNumber < 0) throw new IllegalArgumentException("deviceNumber cannot be negative, got " + deviceNumber); - } - - } - } |