-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTFLibrary.pm
59 lines (40 loc) · 1.14 KB
/
TFLibrary.pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package AI::TensorFlow::Libtensorflow::TFLibrary;
# ABSTRACT: TensorFlow dynamic library handle and ops
use strict;
use warnings;
use AI::TensorFlow::Libtensorflow::Lib qw(arg);
my $ffi = AI::TensorFlow::Libtensorflow::Lib->ffi;
=construct LoadLibrary
=tf_capi TF_LoadLibrary
=cut
$ffi->attach( [ 'LoadLibrary' => 'LoadLibrary' ] => [
arg string => 'library_filename',
arg TF_Status => 'status',
] => 'TF_Library' => sub {
my ($xs, $class, @rest) = @_;
$xs->(@rest);
} );
=method GetOpList
=tf_capi TF_GetOpList
=cut
$ffi->attach( [ 'GetOpList' => 'GetOpList' ] => [
arg TF_Library => 'lib_handle'
] => 'TF_Buffer' );
=destruct DESTROY
=tf_capi TF_DeleteLibraryHandle
=cut
$ffi->attach( [ 'DeleteLibraryHandle' => 'DESTROY' ] => [
arg TF_Library => 'lib_handle'
] => 'void' );
=classmethod GetAllOpList
=for :signature
GetAllOpList()
my $buf = AI::TensorFlow::Libtensorflow::TFLibrary->GetAllOpList();
cmp_ok $buf->length, '>', 0, 'Got OpList buffer';
=for :returns
= TFBuffer
Contains a serialized C<OpList> proto for ops registered in this address space.
=tf_capi TF_GetAllOpList
=cut
$ffi->attach( 'GetAllOpList' => [], 'TF_Buffer' );
1;