Skip to content

Commit e5ed684

Browse files
committed
New codegen, support for Java 11 builds
Signed-off-by: Ryan Nett <[email protected]>
1 parent fbb7ca4 commit e5ed684

File tree

17 files changed

+833
-872
lines changed

17 files changed

+833
-872
lines changed

Diff for: tensorflow-core-kotlin/pom.xml

+9
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,14 @@
4747
<kotlin.version>1.4.21</kotlin.version>
4848
<kotlin.jvmTarget>1.8</kotlin.jvmTarget>
4949
</properties>
50+
51+
<profiles>
52+
<profile>
53+
<id>jdk11</id>
54+
<properties>
55+
<kotlin.jvmTarget>11</kotlin.jvmTarget>
56+
</properties>
57+
</profile>
58+
</profiles>
5059
</project>
5160

Diff for: tensorflow-core-kotlin/tensorflow-core-kotlin-api/src/gen/annotations/org/tensorflow/op/kotlin/DtypesOps.kt

+8-8
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ public class DtypesOps(
7676
* @param fill The value to pad if width > -1. If empty, pads with spaces.
7777
* Another typical value is '0'. String cannot be longer than 1 character.
7878
*/
79-
public fun <T : TType> asString(
80-
input: Operand<T>,
79+
public fun asString(
80+
input: Operand<out TType>,
8181
precision: Long? = null,
8282
scientific: Boolean? = null,
8383
shortest: Boolean? = null,
8484
width: Long? = null,
8585
fill: String? = null
86-
): AsString = java.asString<T>(
86+
): AsString = java.asString(
8787
input,
8888
*listOfNotNull(
8989
precision?.let{ org.tensorflow.op.dtypes.AsString.precision(it) },
@@ -105,11 +105,11 @@ public class DtypesOps(
105105
* @see org.tensorflow.op.DtypesOps.cast
106106
* @param Truncate @param Truncate
107107
*/
108-
public fun <U : TType, T : TType> cast(
109-
x: Operand<T>,
108+
public fun <U : TType> cast(
109+
x: Operand<out TType>,
110110
DstT: Class<U>,
111111
Truncate: Boolean? = null
112-
): Cast<U> = java.cast<U, T>(
112+
): Cast<U> = java.cast<U>(
113113
x,
114114
DstT,
115115
*listOfNotNull(
@@ -164,8 +164,8 @@ public class DtypesOps(
164164
* @param Truncate @param Truncate
165165
*/
166166
@JvmName("castReified")
167-
public inline fun <reified U : TType, T : TType> cast(x: Operand<T>, Truncate: Boolean? = null):
168-
Cast<U> = cast<U, T>(x, U::class.java, Truncate)
167+
public inline fun <reified U : TType> cast(x: Operand<out TType>, Truncate: Boolean? = null):
168+
Cast<U> = cast<U>(x, U::class.java, Truncate)
169169

170170
/**
171171
* Converts two real numbers to a complex number.

Diff for: tensorflow-core-kotlin/tensorflow-core-kotlin-api/src/gen/annotations/org/tensorflow/op/kotlin/ImageOps.kt

+20-20
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ public class ImageOps(
256256
* methods are supported: Bilinear and Nearest Neighbor.
257257
* @param extrapolationValue Value used for extrapolation, when applicable.
258258
*/
259-
public fun <T : TNumber> cropAndResize(
260-
image: Operand<T>,
259+
public fun cropAndResize(
260+
image: Operand<out TNumber>,
261261
boxes: Operand<TFloat32>,
262262
boxInd: Operand<TInt32>,
263263
cropSize: Operand<TInt32>,
264264
method: String? = null,
265265
extrapolationValue: Float? = null
266-
): CropAndResize = java.cropAndResize<T>(
266+
): CropAndResize = java.cropAndResize(
267267
image,
268268
boxes,
269269
boxInd,
@@ -298,13 +298,13 @@ public class ImageOps(
298298
* @param method A string specifying the interpolation method. Only 'bilinear' is
299299
* supported for now.
300300
*/
301-
public fun <T : TNumber> cropAndResizeGradBoxes(
301+
public fun cropAndResizeGradBoxes(
302302
grads: Operand<TFloat32>,
303-
image: Operand<T>,
303+
image: Operand<out TNumber>,
304304
boxes: Operand<TFloat32>,
305305
boxInd: Operand<TInt32>,
306306
method: String? = null
307-
): CropAndResizeGradBoxes = java.cropAndResizeGradBoxes<T>(
307+
): CropAndResizeGradBoxes = java.cropAndResizeGradBoxes(
308308
grads,
309309
image,
310310
boxes,
@@ -783,8 +783,8 @@ public class ImageOps(
783783
* @see org.tensorflow.op.ImageOps.encodePng
784784
* @param compression Compression level.
785785
*/
786-
public fun <T : TNumber> encodePng(image: Operand<T>, compression: Long? = null): EncodePng =
787-
java.encodePng<T>(
786+
public fun encodePng(image: Operand<out TNumber>, compression: Long? = null): EncodePng =
787+
java.encodePng(
788788
image,
789789
*listOfNotNull(
790790
compression?.let{ org.tensorflow.op.image.EncodePng.compression(it) }
@@ -1084,11 +1084,11 @@ public class ImageOps(
10841084
* tensors are
10851085
* aligned, preserving the values at the corner pixels. Defaults to false.
10861086
*/
1087-
public fun <T : TNumber> resizeArea(
1088-
images: Operand<T>,
1087+
public fun resizeArea(
1088+
images: Operand<out TNumber>,
10891089
size: Operand<TInt32>,
10901090
alignCorners: Boolean? = null
1091-
): ResizeArea = java.resizeArea<T>(
1091+
): ResizeArea = java.resizeArea(
10921092
images,
10931093
size,
10941094
*listOfNotNull(
@@ -1112,12 +1112,12 @@ public class ImageOps(
11121112
* aligned, preserving the values at the corner pixels. Defaults to false.
11131113
* @param halfPixelCenters @param halfPixelCenters
11141114
*/
1115-
public fun <T : TNumber> resizeBicubic(
1116-
images: Operand<T>,
1115+
public fun resizeBicubic(
1116+
images: Operand<out TNumber>,
11171117
size: Operand<TInt32>,
11181118
alignCorners: Boolean? = null,
11191119
halfPixelCenters: Boolean? = null
1120-
): ResizeBicubic = java.resizeBicubic<T>(
1120+
): ResizeBicubic = java.resizeBicubic(
11211121
images,
11221122
size,
11231123
*listOfNotNull(
@@ -1142,12 +1142,12 @@ public class ImageOps(
11421142
* aligned, preserving the values at the corner pixels. Defaults to false.
11431143
* @param halfPixelCenters @param halfPixelCenters
11441144
*/
1145-
public fun <T : TNumber> resizeBilinear(
1146-
images: Operand<T>,
1145+
public fun resizeBilinear(
1146+
images: Operand<out TNumber>,
11471147
size: Operand<TInt32>,
11481148
alignCorners: Boolean? = null,
11491149
halfPixelCenters: Boolean? = null
1150-
): ResizeBilinear = java.resizeBilinear<T>(
1150+
): ResizeBilinear = java.resizeBilinear(
11511151
images,
11521152
size,
11531153
*listOfNotNull(
@@ -1321,14 +1321,14 @@ public class ImageOps(
13211321
* @param kernelType @param kernelType
13221322
* @param antialias @param antialias
13231323
*/
1324-
public fun <T : TNumber> scaleAndTranslate(
1325-
images: Operand<T>,
1324+
public fun scaleAndTranslate(
1325+
images: Operand<out TNumber>,
13261326
size: Operand<TInt32>,
13271327
scale: Operand<TFloat32>,
13281328
translation: Operand<TFloat32>,
13291329
kernelType: String? = null,
13301330
antialias: Boolean? = null
1331-
): ScaleAndTranslate = java.scaleAndTranslate<T>(
1331+
): ScaleAndTranslate = java.scaleAndTranslate(
13321332
images,
13331333
size,
13341334
scale,

Diff for: tensorflow-core-kotlin/tensorflow-core-kotlin-api/src/gen/annotations/org/tensorflow/op/kotlin/IoOps.kt

+19-20
Original file line numberDiff line numberDiff line change
@@ -1324,11 +1324,11 @@ public class IoOps(
13241324
* @return a new instance of SerializeManySparse
13251325
* @see org.tensorflow.op.IoOps.serializeManySparse
13261326
*/
1327-
public fun <T : TType> serializeManySparse(
1327+
public fun serializeManySparse(
13281328
sparseIndices: Operand<TInt64>,
1329-
sparseValues: Operand<T>,
1329+
sparseValues: Operand<out TType>,
13301330
sparseShape: Operand<TInt64>
1331-
): SerializeManySparse<TString> = java.serializeManySparse<T>(
1331+
): SerializeManySparse<TString> = java.serializeManySparse(
13321332
sparseIndices,
13331333
sparseValues,
13341334
sparseShape
@@ -1354,12 +1354,12 @@ public class IoOps(
13541354
* @return a new instance of SerializeManySparse
13551355
* @see org.tensorflow.op.IoOps.serializeManySparse
13561356
*/
1357-
public fun <U : TType, T : TType> serializeManySparse(
1357+
public fun <U : TType> serializeManySparse(
13581358
sparseIndices: Operand<TInt64>,
1359-
sparseValues: Operand<T>,
1359+
sparseValues: Operand<out TType>,
13601360
sparseShape: Operand<TInt64>,
13611361
outType: Class<U>
1362-
): SerializeManySparse<U> = java.serializeManySparse<U, T>(
1362+
): SerializeManySparse<U> = java.serializeManySparse<U>(
13631363
sparseIndices,
13641364
sparseValues,
13651365
sparseShape,
@@ -1376,11 +1376,11 @@ public class IoOps(
13761376
* @return a new instance of SerializeSparse
13771377
* @see org.tensorflow.op.IoOps.serializeSparse
13781378
*/
1379-
public fun <T : TType> serializeSparse(
1379+
public fun serializeSparse(
13801380
sparseIndices: Operand<TInt64>,
1381-
sparseValues: Operand<T>,
1381+
sparseValues: Operand<out TType>,
13821382
sparseShape: Operand<TInt64>
1383-
): SerializeSparse<TString> = java.serializeSparse<T>(
1383+
): SerializeSparse<TString> = java.serializeSparse(
13841384
sparseIndices,
13851385
sparseValues,
13861386
sparseShape
@@ -1398,12 +1398,12 @@ public class IoOps(
13981398
* @return a new instance of SerializeSparse
13991399
* @see org.tensorflow.op.IoOps.serializeSparse
14001400
*/
1401-
public fun <U : TType, T : TType> serializeSparse(
1401+
public fun <U : TType> serializeSparse(
14021402
sparseIndices: Operand<TInt64>,
1403-
sparseValues: Operand<T>,
1403+
sparseValues: Operand<out TType>,
14041404
sparseShape: Operand<TInt64>,
14051405
outType: Class<U>
1406-
): SerializeSparse<U> = java.serializeSparse<U, T>(
1406+
): SerializeSparse<U> = java.serializeSparse<U>(
14071407
sparseIndices,
14081408
sparseValues,
14091409
sparseShape,
@@ -1417,8 +1417,7 @@ public class IoOps(
14171417
* @return a new instance of SerializeTensor
14181418
* @see org.tensorflow.op.IoOps.serializeTensor
14191419
*/
1420-
public fun <T : TType> serializeTensor(tensor: Operand<T>): SerializeTensor =
1421-
java.serializeTensor<T>(
1420+
public fun serializeTensor(tensor: Operand<out TType>): SerializeTensor = java.serializeTensor(
14221421
tensor
14231422
)
14241423

@@ -1676,11 +1675,11 @@ public class IoOps(
16761675
* @see org.tensorflow.op.IoOps.serializeManySparse
16771676
*/
16781677
@JvmName("serializeManySparseReified")
1679-
public inline fun <reified U : TType, T : TType> serializeManySparseTyped(
1678+
public inline fun <reified U : TType> serializeManySparseTyped(
16801679
sparseIndices: Operand<TInt64>,
1681-
sparseValues: Operand<T>,
1680+
sparseValues: Operand<out TType>,
16821681
sparseShape: Operand<TInt64>
1683-
): SerializeManySparse<U> = serializeManySparse<U, T>(sparseIndices, sparseValues, sparseShape,
1682+
): SerializeManySparse<U> = serializeManySparse<U>(sparseIndices, sparseValues, sparseShape,
16841683
U::class.java)
16851684

16861685
/**
@@ -1696,10 +1695,10 @@ public class IoOps(
16961695
* @see org.tensorflow.op.IoOps.serializeSparse
16971696
*/
16981697
@JvmName("serializeSparseReified")
1699-
public inline fun <reified U : TType, T : TType> serializeSparseTyped(
1698+
public inline fun <reified U : TType> serializeSparseTyped(
17001699
sparseIndices: Operand<TInt64>,
1701-
sparseValues: Operand<T>,
1700+
sparseValues: Operand<out TType>,
17021701
sparseShape: Operand<TInt64>
1703-
): SerializeSparse<U> = serializeSparse<U, T>(sparseIndices, sparseValues, sparseShape,
1702+
): SerializeSparse<U> = serializeSparse<U>(sparseIndices, sparseValues, sparseShape,
17041703
U::class.java)
17051704
}

0 commit comments

Comments
 (0)