Skip to content

Commit 7795db9

Browse files
lu-wang-gtflite-support-robot
authored andcommitted
Fix the typos in support and task library
PiperOrigin-RevId: 401385404
1 parent 864b30b commit 7795db9

File tree

6 files changed

+16
-16
lines changed

6 files changed

+16
-16
lines changed

tensorflow_lite_support/java/src/java/org/tensorflow/lite/support/audio/TensorAudio.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public static TensorAudio create(AudioFormat format, int sampleCounts) {
9696
public abstract static class TensorAudioFormat {
9797
private static final int DEFAULT_CHANNELS = 1;
9898

99-
/** Creates a {@link TensorAudioFormat} instance from Android AudioForamt class. */
99+
/** Creates a {@link TensorAudioFormat} instance from Android AudioFormat class. */
100100
@RequiresApi(Build.VERSION_CODES.M)
101101
public static TensorAudioFormat create(AudioFormat format) {
102102
return TensorAudioFormat.builder()
@@ -202,7 +202,7 @@ public void load(short[] src, int offsetInShort, int sizeInShort) {
202202
*
203203
* @param record an instance of {@link android.media.AudioRecord}
204204
* @return number of captured audio values whose size is {@code channelCount * sampleCount}. If
205-
* there was no new data in the AudioRecord or an error occured, this method will return 0.
205+
* there was no new data in the AudioRecord or an error occurred, this method will return 0.
206206
* @throws IllegalArgumentException for unsupported audio encoding format
207207
* @throws IllegalStateException if reading from AudioRecord failed
208208
*/
@@ -287,15 +287,15 @@ public FloatRingBuffer(int flatSize) {
287287

288288
/**
289289
* Loads the entire float array to the ring buffer. If the float array is longer than ring
290-
* buffer's capacity, samples with lower indicies in the array will be ignored.
290+
* buffer's capacity, samples with lower indices in the array will be ignored.
291291
*/
292292
public void load(float[] newData) {
293293
load(newData, 0, newData.length);
294294
}
295295

296296
/**
297297
* Loads a slice of the float array to the ring buffer. If the float array is longer than ring
298-
* buffer's capacity, samples with lower indicies in the array will be ignored.
298+
* buffer's capacity, samples with lower indices in the array will be ignored.
299299
*/
300300
public void load(float[] newData, int offset, int size) {
301301
checkArgument(

tensorflow_lite_support/java/src/java/org/tensorflow/lite/support/image/ImageProperties.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static Builder builder() {
4343
}
4444

4545
/**
46-
* Builder for {@link ImageProperties}. Different image objects may reqiure different properties.
46+
* Builder for {@link ImageProperties}. Different image objects may require different properties.
4747
* See the detais below:
4848
*
4949
* <ul>

tensorflow_lite_support/java/src/java/org/tensorflow/lite/support/model/Model.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public String getPath() {
221221
}
222222

223223
/**
224-
* Gets the Tensor associated with the provdied input index.
224+
* Gets the Tensor associated with the provided input index.
225225
*
226226
* @throws IllegalStateException if the interpreter is closed.
227227
*/
@@ -230,7 +230,7 @@ public Tensor getInputTensor(int inputIndex) {
230230
}
231231

232232
/**
233-
* Gets the Tensor associated with the provdied output index.
233+
* Gets the Tensor associated with the provided output index.
234234
*
235235
* @throws IllegalStateException if the interpreter is closed.
236236
*/

tensorflow_lite_support/java/src/java/org/tensorflow/lite/support/tensorbuffer/TensorBuffer.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public ByteBuffer getBuffer() {
163163
* @throws IllegalStateException if the underlying data is corrupted
164164
*/
165165
public int getFlatSize() {
166-
assertShapeIsCorect();
166+
assertShapeIsCorrect();
167167
return flatSize;
168168
}
169169

@@ -174,7 +174,7 @@ public int getFlatSize() {
174174
*/
175175
@NonNull
176176
public int[] getShape() {
177-
assertShapeIsCorect();
177+
assertShapeIsCorrect();
178178
return Arrays.copyOf(shape, shape.length);
179179
}
180180

@@ -199,7 +199,7 @@ public int[] getShape() {
199199
* For example, a TensorBuffer with shape {2, 3} that represents the following array,
200200
* [[0.0f, 1.0f, 2.0f], [3.0f, 4.0f, 5.0f]].
201201
*
202-
* The fourth element (whose value is 3.0f) in the TensorBuffer can be retrived by:
202+
* The fourth element (whose value is 3.0f) in the TensorBuffer can be retrieved by:
203203
* float v = tensorBuffer.getFloatValue(3);
204204
* </pre>
205205
*
@@ -226,7 +226,7 @@ public int[] getShape() {
226226
* For example, a TensorBuffer with shape {2, 3} that represents the following array,
227227
* [[0.0f, 1.0f, 2.0f], [3.0f, 4.0f, 5.0f]].
228228
*
229-
* The fourth element (whose value is 3.0f) in the TensorBuffer can be retrived by:
229+
* The fourth element (whose value is 3.0f) in the TensorBuffer can be retrieved by:
230230
* int v = tensorBuffer.getIntValue(3);
231231
* Note that v is converted from 3.0f to 3 as a result of type conversion.
232232
* </pre>
@@ -459,7 +459,7 @@ private void allocateMemory(@NonNull int[] shape) {
459459
* Verifies if the shape of the {@link TensorBuffer} matched the size of the underlying {@link
460460
* ByteBuffer}.
461461
*/
462-
private void assertShapeIsCorect() {
462+
private void assertShapeIsCorrect() {
463463
int flatSize = computeFlatSize(shape);
464464
checkState(
465465
(buffer.limit() == getTypeSize() * flatSize),

tensorflow_lite_support/java/src/java/org/tensorflow/lite/task/vision/core/BaseVisionTaskApi.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private static FrameBufferData createFrameBufferFromByteBuffer(
145145
/*byteArrayHandle=*/ 0,
146146
/*byteArray=*/ new byte[0]);
147147
} else {
148-
// If the the byte array is copied in jni (during GetByteArrayElements), need to free
148+
// If the byte array is copied in jni (during GetByteArrayElements), need to free
149149
// the copied array once inference is done.
150150
long[] byteArrayHandle = new long[1];
151151
byte[] byteArray = getBytesFromByteBuffer(byteBuffer);
@@ -189,7 +189,7 @@ public static FrameBufferData create(
189189

190190
abstract long getByteArrayHandle();
191191

192-
// Package private method for transfering data.
192+
// Package private method for transferring data.
193193
@SuppressWarnings("mutable")
194194
abstract byte[] getByteArray();
195195
}

tensorflow_lite_support/java/src/native/task/audio/classifier/audio_classifier_jni.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ Java_org_tensorflow_lite_task_audio_classifier_AudioClassifier_classifyNative(
296296
jbyte* native_array = env->GetByteArrayElements(java_array, nullptr);
297297
if (native_array == nullptr) {
298298
ThrowException(env, kAssertionError,
299-
"Error occured when converting the java audio input array "
299+
"Error occurred when converting the java audio input array "
300300
"to native array.");
301301
return nullptr;
302302
}
@@ -325,7 +325,7 @@ Java_org_tensorflow_lite_task_audio_classifier_AudioClassifier_classifyNative(
325325
}
326326
} else {
327327
ThrowException(env, kAssertionError,
328-
"Error occured when creating the AudioBuffer: %s",
328+
"Error occurred when creating the AudioBuffer: %s",
329329
audio_buffer_or.status().message().data());
330330
}
331331

0 commit comments

Comments
 (0)