Skip to content

Commit 6100799

Browse files
committed
No formatting on generation, update explicit API settings
Signed-off-by: Ryan Nett <[email protected]>
1 parent 9113925 commit 6100799

File tree

24 files changed

+4840
-5004
lines changed

24 files changed

+4840
-5004
lines changed

tensorflow-kotlin-parent/tensorflow-core-kotlin/pom.xml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,21 @@
107107
<artifactId>kotlin-maven-plugin</artifactId>
108108
<version>${kotlin.version}</version>
109109
<configuration>
110-
<args>
111-
<arg>-Xopt-in=kotlin.contracts.ExperimentalContracts</arg>
112-
<arg>-Xexplicit-api=strict</arg>
113-
</args>
114110
</configuration>
115111
<executions>
112+
<execution>
113+
<id>compile</id>
114+
<goals>
115+
<goal>compile</goal>
116+
</goals>
117+
<configuration>
118+
<args>
119+
<arg>-Xopt-in=kotlin.contracts.ExperimentalContracts</arg>
120+
<arg>-Xexplicit-api=strict</arg>
121+
</args>
122+
</configuration>
123+
</execution>
124+
116125
<execution>
117126
<id>kapt</id>
118127
<goals>

tensorflow-kotlin-parent/tensorflow-core-kotlin/src/gen/annotations/org/tensorflow/op/kotlin/AudioOps.kt

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
//
1818
package org.tensorflow.op.kotlin
1919

20+
import kotlin.Boolean
21+
import kotlin.Float
22+
import kotlin.Long
2023
import org.tensorflow.Operand
2124
import org.tensorflow.op.Scope
2225
import org.tensorflow.op.audio.AudioSpectrogram
@@ -26,9 +29,6 @@ import org.tensorflow.op.audio.Mfcc
2629
import org.tensorflow.types.TFloat32
2730
import org.tensorflow.types.TInt32
2831
import org.tensorflow.types.TString
29-
import kotlin.Boolean
30-
import kotlin.Float
31-
import kotlin.Long
3232

3333
/**
3434
* An API for building `audio` operations as [Op][org.tensorflow.op.Op]s
@@ -54,24 +54,24 @@ public class AudioOps(
5454
* slices of frequency information, one slice for each window of time. By joining
5555
* these together into a sequence, they form a distinctive fingerprint of the sound
5656
* over time.
57-
*
57+
*
5858
* This op expects to receive audio data as an input, stored as floats in the range
5959
* -1 to 1, together with a window width in samples, and a stride specifying how
6060
* far to move the window between slices. From this it generates a three
6161
* dimensional output. The first dimension is for the channels in the input, so a
6262
* stereo audio input would have two here for example. The second dimension is time,
6363
* with successive frequency slices. The third dimension has an amplitude value for
6464
* each frequency during that time slice.
65-
*
65+
*
6666
* This means the layout when converted and saved as an image is rotated 90 degrees
6767
* clockwise from a typical spectrogram. Time is descending down the Y axis, and
6868
* the frequency decreases from left to right.
69-
*
69+
*
7070
* Each value in the result represents the square root of the sum of the real and
7171
* imaginary parts of an FFT on the current window of samples. In this way, the
7272
* lowest dimension represents the power of each frequency in the current window,
7373
* and adjacent windows are concatenated in the next dimension.
74-
*
74+
*
7575
* To get a more intuitive and visual look at what this operation does, you can run
7676
* tensorflow/examples/wav_to_spectrogram to read in an audio file and save out the
7777
* resulting spectrogram as a PNG image.
@@ -94,27 +94,27 @@ public class AudioOps(
9494
windowSize: Long,
9595
stride: Long,
9696
magnitudeSquared: Boolean? = null
97-
): AudioSpectrogram = java.audioSpectrogram(
97+
): AudioSpectrogram = java.audioSpectrogram(
9898
input,
9999
windowSize,
100100
stride,
101101
*listOfNotNull(
102-
magnitudeSquared?.let { org.tensorflow.op.audio.AudioSpectrogram.magnitudeSquared(it) }
102+
magnitudeSquared?.let{ org.tensorflow.op.audio.AudioSpectrogram.magnitudeSquared(it) }
103103
).toTypedArray()
104-
)
104+
)
105105

106106
/**
107107
* Decode a 16-bit PCM WAV file to a float tensor.
108108
* The -32768 to 32767 signed 16-bit values will be scaled to -1.0 to 1.0 in float.
109-
*
109+
*
110110
* When desired_channels is set, if the input contains fewer channels than this
111111
* then the last channel will be duplicated to give the requested number, else if
112112
* the input has more channels than requested then the additional channels will be
113113
* ignored.
114-
*
114+
*
115115
* If desired_samples is set, then the audio will be cropped or padded with zeroes
116116
* to the requested length.
117-
*
117+
*
118118
* The first output contains a Tensor with the content of the audio samples. The
119119
* lowest dimension will be the number of channels, and the second will be the
120120
* number of samples. For example, a ten-sample-long stereo WAV file should give an
@@ -137,21 +137,21 @@ public class AudioOps(
137137
contents: Operand<TString>,
138138
desiredChannels: Long? = null,
139139
desiredSamples: Long? = null
140-
): DecodeWav = java.decodeWav(
140+
): DecodeWav = java.decodeWav(
141141
contents,
142142
*listOfNotNull(
143-
desiredChannels?.let { org.tensorflow.op.audio.DecodeWav.desiredChannels(it) },
144-
desiredSamples?.let { org.tensorflow.op.audio.DecodeWav.desiredSamples(it) }
143+
desiredChannels?.let{ org.tensorflow.op.audio.DecodeWav.desiredChannels(it) },
144+
desiredSamples?.let{ org.tensorflow.op.audio.DecodeWav.desiredSamples(it) }
145145
).toTypedArray()
146-
)
146+
)
147147

148148
/**
149149
* Encode audio data using the WAV file format.
150150
* This operation will generate a string suitable to be saved out to create a .wav
151151
* audio file. It will be encoded in the 16-bit PCM format. It takes in float
152152
* values in the range -1.0f to 1.0f, and any outside that value will be clamped to
153153
* that range.
154-
*
154+
*
155155
* `audio` is a 2-D float Tensor of shape `&#91;length, channels&#93;`.
156156
* `sample_rate` is a scalar Tensor holding the rate to use (e.g. 44100).
157157
*
@@ -161,9 +161,9 @@ public class AudioOps(
161161
* @see org.tensorflow.op.AudioOps.encodeWav
162162
*/
163163
public fun encodeWav(audio: Operand<TFloat32>, sampleRate: Operand<TInt32>): EncodeWav =
164-
java.encodeWav(
165-
audio,
166-
sampleRate
164+
java.encodeWav(
165+
audio,
166+
sampleRate
167167
)
168168

169169
/**
@@ -208,14 +208,14 @@ public class AudioOps(
208208
lowerFrequencyLimit: Float? = null,
209209
filterbankChannelCount: Long? = null,
210210
dctCoefficientCount: Long? = null
211-
): Mfcc = java.mfcc(
211+
): Mfcc = java.mfcc(
212212
spectrogram,
213213
sampleRate,
214214
*listOfNotNull(
215-
upperFrequencyLimit?.let { org.tensorflow.op.audio.Mfcc.upperFrequencyLimit(it) },
216-
lowerFrequencyLimit?.let { org.tensorflow.op.audio.Mfcc.lowerFrequencyLimit(it) },
217-
filterbankChannelCount?.let { org.tensorflow.op.audio.Mfcc.filterbankChannelCount(it) },
218-
dctCoefficientCount?.let { org.tensorflow.op.audio.Mfcc.dctCoefficientCount(it) }
215+
upperFrequencyLimit?.let{ org.tensorflow.op.audio.Mfcc.upperFrequencyLimit(it) },
216+
lowerFrequencyLimit?.let{ org.tensorflow.op.audio.Mfcc.lowerFrequencyLimit(it) },
217+
filterbankChannelCount?.let{ org.tensorflow.op.audio.Mfcc.filterbankChannelCount(it) },
218+
dctCoefficientCount?.let{ org.tensorflow.op.audio.Mfcc.dctCoefficientCount(it) }
219219
).toTypedArray()
220-
)
220+
)
221221
}

tensorflow-kotlin-parent/tensorflow-core-kotlin/src/gen/annotations/org/tensorflow/op/kotlin/BitwiseOps.kt

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class BitwiseOps(
4949
* Elementwise computes the bitwise AND of `x` and `y`.
5050
* The result will have those bits set, that are set in both `x` and `y`. The
5151
* computation is performed on the underlying representations of `x` and `y`.
52-
*
52+
*
5353
* For example:
5454
* ```
5555
* import tensorflow as tf
@@ -64,7 +64,7 @@ public class BitwiseOps(
6464
*
6565
* res = bitwise_ops.bitwise_and(lhs, rhs)
6666
* tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
67-
*
67+
*
6868
* ```
6969
*
7070
* @param <T> data type for `z` output
@@ -75,16 +75,16 @@ public class BitwiseOps(
7575
* @see org.tensorflow.op.BitwiseOps.bitwiseAnd
7676
*/
7777
public fun <T : TNumber> bitwiseAnd(x: Operand<T>, y: Operand<T>): BitwiseAnd<T> =
78-
java.bitwiseAnd<T>(
79-
x,
80-
y
78+
java.bitwiseAnd<T>(
79+
x,
80+
y
8181
)
8282

8383
/**
8484
* Elementwise computes the bitwise OR of `x` and `y`.
8585
* The result will have those bits set, that are set in `x`, `y` or both. The
8686
* computation is performed on the underlying representations of `x` and `y`.
87-
*
87+
*
8888
* For example:
8989
* ```
9090
* import tensorflow as tf
@@ -99,7 +99,7 @@ public class BitwiseOps(
9999
*
100100
* res = bitwise_ops.bitwise_or(lhs, rhs)
101101
* tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
102-
*
102+
*
103103
* ```
104104
*
105105
* @param <T> data type for `z` output
@@ -110,16 +110,16 @@ public class BitwiseOps(
110110
* @see org.tensorflow.op.BitwiseOps.bitwiseOr
111111
*/
112112
public fun <T : TNumber> bitwiseOr(x: Operand<T>, y: Operand<T>): BitwiseOr<T> =
113-
java.bitwiseOr<T>(
114-
x,
115-
y
113+
java.bitwiseOr<T>(
114+
x,
115+
y
116116
)
117117

118118
/**
119119
* Elementwise computes the bitwise XOR of `x` and `y`.
120120
* The result will have those bits set, that are different in `x` and `y`. The
121121
* computation is performed on the underlying representations of `x` and `y`.
122-
*
122+
*
123123
* For example:
124124
* ```
125125
* import tensorflow as tf
@@ -134,7 +134,7 @@ public class BitwiseOps(
134134
*
135135
* res = bitwise_ops.bitwise_xor(lhs, rhs)
136136
* tf.assert_equal(tf.cast(res, tf.float32), exp) # TRUE
137-
*
137+
*
138138
* ```
139139
*
140140
* @param <T> data type for `z` output
@@ -145,9 +145,9 @@ public class BitwiseOps(
145145
* @see org.tensorflow.op.BitwiseOps.bitwiseXor
146146
*/
147147
public fun <T : TNumber> bitwiseXor(x: Operand<T>, y: Operand<T>): BitwiseXor<T> =
148-
java.bitwiseXor<T>(
149-
x,
150-
y
148+
java.bitwiseXor<T>(
149+
x,
150+
y
151151
)
152152

153153
/**
@@ -156,7 +156,7 @@ public class BitwiseOps(
156156
* Flip each bit of supported types. For example, type `int8` (decimal 2) binary 00000010
157157
* becomes (decimal -3) binary 11111101.
158158
* This operation is performed on each element of the tensor argument `x`.
159-
*
159+
*
160160
* Example:
161161
* ```
162162
* import tensorflow as tf
@@ -192,7 +192,7 @@ public class BitwiseOps(
192192
* inverted = bitwise_ops.invert(input_tensor)
193193
* expected = tf.constant([dtype.max - x for x in inputs], dtype=tf.float32)
194194
* tf.assert_equal(tf.cast(inverted, tf.float32), tf.cast(expected, tf.float32))
195-
*
195+
*
196196
* ```
197197
*
198198
* @param <T> data type for `y` output
@@ -201,15 +201,15 @@ public class BitwiseOps(
201201
* @return a new instance of Invert
202202
* @see org.tensorflow.op.BitwiseOps.invert
203203
*/
204-
public fun <T : TNumber> invert(x: Operand<T>): Invert<T> = java.invert<T>(
204+
public fun <T : TNumber> invert(x: Operand<T>): Invert<T> = java.invert<T>(
205205
x
206-
)
206+
)
207207

208208
/**
209209
* Elementwise computes the bitwise left-shift of `x` and `y`.
210210
* If `y` is negative, or greater than or equal to the width of `x` in bits the
211211
* result is implementation defined.
212-
*
212+
*
213213
* Example:
214214
* ```
215215
* import tensorflow as tf
@@ -235,7 +235,7 @@ public class BitwiseOps(
235235
* rhs = np.array([-1, -5, -3, -14], dtype=np.int8)
236236
* bitwise_ops.left_shift(lhs, rhs)
237237
* # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)>
238-
*
238+
*
239239
* ```
240240
*
241241
* @param <T> data type for `z` output
@@ -246,19 +246,19 @@ public class BitwiseOps(
246246
* @see org.tensorflow.op.BitwiseOps.leftShift
247247
*/
248248
public fun <T : TNumber> leftShift(x: Operand<T>, y: Operand<T>): LeftShift<T> =
249-
java.leftShift<T>(
250-
x,
251-
y
249+
java.leftShift<T>(
250+
x,
251+
y
252252
)
253253

254254
/**
255255
* Elementwise computes the bitwise right-shift of `x` and `y`.
256256
* Performs a logical shift for unsigned integer types, and an arithmetic shift
257257
* for signed integer types.
258-
*
258+
*
259259
* If `y` is negative, or greater than or equal to than the width of `x` in bits
260260
* the result is implementation defined.
261-
*
261+
*
262262
* Example:
263263
* ```
264264
* import tensorflow as tf
@@ -284,7 +284,7 @@ public class BitwiseOps(
284284
* rhs = np.array([-1, -5, -3, -14], dtype=np.int8)
285285
* bitwise_ops.right_shift(lhs, rhs)
286286
* # <tf.Tensor: shape=(4,), dtype=int8, numpy=array([ -2, 64, 101, 32], dtype=int8)>
287-
*
287+
*
288288
* ```
289289
*
290290
* @param <T> data type for `z` output
@@ -295,8 +295,8 @@ public class BitwiseOps(
295295
* @see org.tensorflow.op.BitwiseOps.rightShift
296296
*/
297297
public fun <T : TNumber> rightShift(x: Operand<T>, y: Operand<T>): RightShift<T> =
298-
java.rightShift<T>(
299-
x,
300-
y
298+
java.rightShift<T>(
299+
x,
300+
y
301301
)
302302
}

0 commit comments

Comments
 (0)