File tree 10 files changed +19
-19
lines changed
tensorflow-core/tensorflow-core-api/src/main/java/org/tensorflow/internal/types
10 files changed +19
-19
lines changed Original file line number Diff line number Diff line change 13
13
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_BFLOAT16} tensors
14
14
* to a n-dimensional data space.
15
15
*/
16
- public class TBfloat16Mapper extends TensorMapper <TBfloat16 > {
16
+ public final class TBfloat16Mapper extends TensorMapper <TBfloat16 > {
17
17
18
18
@ Override
19
- public TBfloat16 mapDense (RawTensor tensor ) {
19
+ protected TBfloat16 mapDense (RawTensor tensor ) {
20
20
FloatDataBuffer buffer = DataLayouts .BFLOAT16 .applyTo (TensorBuffers .toShorts (nativeHandle (tensor )));
21
21
return new DenseTBfloat16 (tensor , buffer );
22
22
}
23
23
24
- private static class DenseTBfloat16 extends FloatDenseNdArray implements TBfloat16 {
24
+ private static final class DenseTBfloat16 extends FloatDenseNdArray implements TBfloat16 {
25
25
26
26
@ Override
27
27
public DataType <TBfloat16 > dataType () {
Original file line number Diff line number Diff line change 12
12
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_BOOL} tensors
13
13
* to a n-dimensional data space.
14
14
*/
15
- public class TBoolMapper extends TensorMapper <TBool > {
15
+ public final class TBoolMapper extends TensorMapper <TBool > {
16
16
17
17
@ Override
18
18
protected TBool mapDense (RawTensor tensor ) {
Original file line number Diff line number Diff line change 13
13
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_HALF} tensors
14
14
* to a n-dimensional data space.
15
15
*/
16
- public class TFloat16Mapper extends TensorMapper <TFloat16 > {
16
+ public final class TFloat16Mapper extends TensorMapper <TFloat16 > {
17
17
18
18
@ Override
19
19
protected TFloat16 mapDense (RawTensor tensor ) {
20
20
FloatDataBuffer buffer = DataLayouts .FLOAT16 .applyTo (TensorBuffers .toShorts (nativeHandle (tensor )));
21
21
return new DenseTFloat16 (tensor , buffer );
22
22
}
23
23
24
- private static class DenseTFloat16 extends FloatDenseNdArray implements TFloat16 {
24
+ private static final class DenseTFloat16 extends FloatDenseNdArray implements TFloat16 {
25
25
26
26
@ Override
27
27
public DataType <?> dataType () {
Original file line number Diff line number Diff line change 12
12
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_FLOAT} tensors
13
13
* to a n-dimensional data space.
14
14
*/
15
- public class TFloat32Mapper extends TensorMapper <TFloat32 > {
15
+ public final class TFloat32Mapper extends TensorMapper <TFloat32 > {
16
16
17
17
@ Override
18
18
protected TFloat32 mapDense (RawTensor tensor ) {
19
19
FloatDataBuffer buffer = TensorBuffers .toFloats (nativeHandle (tensor ));
20
20
return new DenseTFloat32 (tensor , buffer );
21
21
}
22
22
23
- private static class DenseTFloat32 extends FloatDenseNdArray implements TFloat32 {
23
+ private static final class DenseTFloat32 extends FloatDenseNdArray implements TFloat32 {
24
24
25
25
@ Override
26
26
public DataType <?> dataType () {
Original file line number Diff line number Diff line change 12
12
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_DOUBLE} tensors
13
13
* to a n-dimensional data space.
14
14
*/
15
- public class TFloat64Mapper extends TensorMapper <TFloat64 > {
15
+ public final class TFloat64Mapper extends TensorMapper <TFloat64 > {
16
16
17
17
@ Override
18
18
protected TFloat64 mapDense (RawTensor tensor ) {
19
19
DoubleDataBuffer buffer = TensorBuffers .toDoubles (nativeHandle (tensor ));
20
20
return new DenseTFloat64 (tensor , buffer );
21
21
}
22
22
23
- private static class DenseTFloat64 extends DoubleDenseNdArray implements TFloat64 {
23
+ private static final class DenseTFloat64 extends DoubleDenseNdArray implements TFloat64 {
24
24
25
25
@ Override
26
26
public DataType <?> dataType () {
Original file line number Diff line number Diff line change 12
12
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_INT32} tensors
13
13
* to a n-dimensional data space.
14
14
*/
15
- public class TInt32Mapper extends TensorMapper <TInt32 > {
15
+ public final class TInt32Mapper extends TensorMapper <TInt32 > {
16
16
17
17
@ Override
18
18
protected TInt32 mapDense (RawTensor tensor ) {
19
19
IntDataBuffer buffer = TensorBuffers .toInts (nativeHandle (tensor ));
20
20
return new DenseTInt32 (tensor , buffer );
21
21
}
22
22
23
- private static class DenseTInt32 extends IntDenseNdArray implements TInt32 {
23
+ private static final class DenseTInt32 extends IntDenseNdArray implements TInt32 {
24
24
25
25
@ Override
26
26
public DataType <?> dataType () {
Original file line number Diff line number Diff line change 12
12
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_INT64} tensors
13
13
* to a n-dimensional data space.
14
14
*/
15
- public class TInt64Mapper extends TensorMapper <TInt64 > {
15
+ public final class TInt64Mapper extends TensorMapper <TInt64 > {
16
16
17
17
@ Override
18
18
protected TInt64 mapDense (RawTensor tensor ) {
19
19
LongDataBuffer buffer = TensorBuffers .toLongs (nativeHandle (tensor ));
20
20
return new DenseTInt64 (tensor , buffer );
21
21
}
22
22
23
- private static class DenseTInt64 extends LongDenseNdArray implements TInt64 {
23
+ private static final class DenseTInt64 extends LongDenseNdArray implements TInt64 {
24
24
25
25
@ Override
26
26
public DataType <?> dataType () {
Original file line number Diff line number Diff line change 13
13
*
14
14
* @param <T> source of bytes ({@code byte[]} or {@code String})
15
15
*/
16
- public class TStringInitializer <T > implements Consumer <TString > {
16
+ public final class TStringInitializer <T > implements Consumer <TString > {
17
17
18
18
public TStringInitializer (NdArray <T > source , Function <T , byte []> byteExtractor ) {
19
19
this .byteSequencer = new ByteSequencer <>(source , byteExtractor );
Original file line number Diff line number Diff line change 21
21
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_STRING} tensors
22
22
* to a n-dimensional data space.
23
23
*/
24
- public class TStringMapper extends TensorMapper <TString > {
24
+ public final class TStringMapper extends TensorMapper <TString > {
25
25
26
26
private static final DataLayout <DataBuffer <byte []>, String > UTF_8_LAYOUT =
27
27
DataLayouts .ofStrings (StandardCharsets .UTF_8 );
@@ -46,7 +46,7 @@ interface TStringInternal extends TString {
46
46
<T > void init (ByteSequencer <T > byteSequencer );
47
47
}
48
48
49
- private static class DenseTString extends DenseNdArray <String > implements TStringInternal {
49
+ private static final class DenseTString extends DenseNdArray <String > implements TStringInternal {
50
50
51
51
@ Override
52
52
public <T > void init (ByteSequencer <T > byteSequencer ) {
Original file line number Diff line number Diff line change 12
12
* Maps memory of {@link org.tensorflow.proto.framework.DataType#DT_UINT8} tensors
13
13
* to a n-dimensional data space.
14
14
*/
15
- public class TUint8Mapper extends TensorMapper <TUint8 > {
15
+ public final class TUint8Mapper extends TensorMapper <TUint8 > {
16
16
17
17
@ Override
18
18
protected TUint8 mapDense (RawTensor tensor ) {
19
19
ByteDataBuffer buffer = TensorBuffers .toBytes (nativeHandle (tensor ));
20
20
return new DenseTUint8 (tensor , buffer );
21
21
}
22
22
23
- private static class DenseTUint8 extends ByteDenseNdArray implements TUint8 {
23
+ private static final class DenseTUint8 extends ByteDenseNdArray implements TUint8 {
24
24
25
25
@ Override
26
26
public DataType <?> dataType () {
You can’t perform that action at this time.
0 commit comments