AI::TensorFlow::Libtensorflow::DataType - Datatype enum
use AI::TensorFlow::Libtensorflow::DataType qw(FLOAT @DTYPES); use List::Util qw(max); my $dtype = FLOAT; is FLOAT->Size, 4, 'FLOAT is 4 bytes large'; is max(map { $_->Size } @DTYPES), 16, 'Largest type has sizeof() == 16 bytes';
Enum representing native data types used inside of containers such as TFTensor.
String.
Boolean.
16-bit half-precision floating-point (float16).
float16
32-bit single-precision floating-point (float32).
float32
64-bit double-precision floating-point (float64).
float64
16-bit truncated floating-point.
32-bit single-precision complex floating-point.
64-bit double-precision complex floating-point.
8-bit signed integer.
16-bit signed integer.
32-bit signed integer.
64-bit signed integer.
8-bit unsigned integer.
16-bit unsigned integer.
32-bit unsigned integer.
64-bit unsigned integer.
8-bit quantized signed integer.
16-bit quantized signed integer.
32-bit quantized signed integer.
8-bit quantized unsigned integer.
16-bit quantized unsigned integer.
Handle to a mutable resource.
Variant.
my $size = $dtype->Size();
Returns
The number of bytes used for the DataType $dtype. Returns 0 for variable length types such as STRING or for invalid types.
$dtype
0
STRING
C API: TF_DataTypeSize
TF_DataTypeSize
==
Numeric equality of the underlying enum integer value.
use AI::TensorFlow::Libtensorflow::DataType qw(FLOAT); cmp_ok FLOAT, '==', FLOAT, 'Compare FLOAT objects numerically'; cmp_ok FLOAT, '==', 1 , 'FLOAT enumeration is internally 1';
eq
Compare string equality against type name.
use AI::TensorFlow::Libtensorflow::DataType qw(FLOAT); cmp_ok FLOAT, 'eq', 'FLOAT', 'Compare FLOAT object to string';
""
Stringification to the name of the enumerated type name (e.g., FLOAT, DOUBLE).
use AI::TensorFlow::Libtensorflow::DataType qw(DOUBLE); is "@{[ DOUBLE ]}", 'DOUBLE', 'Stringifies';
Zakariyya Mughal <zmughal@cpan.org>
This software is Copyright (c) 2022-2023 by Auto-Parallel Technologies, Inc.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install AI::TensorFlow::Libtensorflow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AI::TensorFlow::Libtensorflow
CPAN shell
perl -MCPAN -e shell install AI::TensorFlow::Libtensorflow
For more information on module installation, please visit the detailed CPAN module installation guide.