what-the-bank/sources/com/google/android/gms/internal/firebase_ml/zzpc.java

82 lines
2.6 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package com.google.android.gms.internal.firebase_ml;
import com.google.android.gms.common.internal.Preconditions;
import com.google.android.gms.internal.firebase_ml.zzmd;
import com.google.firebase.ml.common.FirebaseMLException;
import java.util.ArrayList;
import java.util.Arrays;
/* loaded from: classes2.dex */
public final class zzpc {
private final int type;
private final int[] zzasy;
public zzpc(int i, int[] iArr) {
Preconditions.checkNotNull(iArr, "Data dimensions should not be null.");
Preconditions.checkArgument(iArr.length > 0, "Data dimensions can not be empty");
for (int i2 : iArr) {
Preconditions.checkArgument(i2 > 0, "Each dimension must be a positive integer");
}
this.type = i;
this.zzasy = Arrays.copyOf(iArr, iArr.length);
}
/* JADX INFO: Access modifiers changed from: package-private */
public final int zzmt() throws FirebaseMLException {
int i = this.type;
int i2 = 4;
if (i != 1 && i != 2) {
if (i == 3) {
i2 = 1;
} else {
if (i != 4) {
StringBuilder sb = new StringBuilder(36);
sb.append("Not supported data type: ");
sb.append(i);
throw new FirebaseMLException(sb.toString(), 3);
}
i2 = 8;
}
}
int i3 = 0;
while (true) {
int[] iArr = this.zzasy;
if (i3 >= iArr.length) {
return i2;
}
i2 *= iArr[i3];
i3++;
}
}
public final zzmd.zzm.zzb zzmu() {
zzmd.zzm.zzb.EnumC0013zzb enumC0013zzb;
ArrayList arrayList = new ArrayList();
for (int i : this.zzasy) {
arrayList.add(Integer.valueOf(i));
}
zzmd.zzm.zzb.zza zzjm = zzmd.zzm.zzb.zzjm();
int i2 = this.type;
if (i2 == 1) {
enumC0013zzb = zzmd.zzm.zzb.EnumC0013zzb.TYPE_FLOAT32;
} else if (i2 == 2) {
enumC0013zzb = zzmd.zzm.zzb.EnumC0013zzb.TYPE_INT32;
} else if (i2 == 3) {
enumC0013zzb = zzmd.zzm.zzb.EnumC0013zzb.TYPE_BYTE;
} else if (i2 == 4) {
enumC0013zzb = zzmd.zzm.zzb.EnumC0013zzb.TYPE_LONG;
} else {
enumC0013zzb = zzmd.zzm.zzb.EnumC0013zzb.UNKNOWN_DATA_TYPE;
}
return (zzmd.zzm.zzb) ((zzue) zzjm.zzb(enumC0013zzb).zzf(arrayList).zzrj());
}
public final int[] zzms() {
return this.zzasy;
}
public final int getType() {
return this.type;
}
}