blob: 39b4e59d04f97358b2ddbe736a09828f9cacc4ed [file] [log] [blame]
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.example.android.nn.benchmark;
public class NNTestList {
/**
* Define enum type for test names
*/
public enum TestName {
MobileNet_FLOAT ("MobileNet float32", 160.f),
MobileNet_QUANT8 ("MobileNet quantized", 50.f);
private final String name;
public final float baseline;
private TestName(String s, float base) {
name = s;
baseline = base;
}
private TestName(String s) {
name = s;
baseline = 1.f;
}
// return quoted string as displayed test name
public String toString() {
return name;
}
}
static NNTestBase newTest(TestName testName) {
switch(testName) {
case MobileNet_FLOAT:
return new NNTestBase("mobilenet_float", new int[]{1, 224, 224, 3});
case MobileNet_QUANT8:
return new NNTestBase("mobilenet_quantized", new int[]{1, 224, 224, 3});
default:
return null;
}
}
}