AI-TensorFlow-Libtensorflow
view release on metacpan or search on metacpan
lib/AI/TensorFlow/Libtensorflow/Buffer.pm view on Meta::CPAN
C<<<
NewFromString( $proto )
>>>
=back
Makes a copy of the input and sets an appropriate deallocator. Useful for
passing in read-only, input protobufs.
my $data = 'bytes';
my $buffer = Buffer->NewFromString(\$data);
ok $buffer, 'create buffer from string';
is $buffer->length, bytes::length($data), 'same length as string';
B<Parameters>
=over 4
=item ScalarRef[Bytes] $proto
=back
B<Returns>
=over 4
=item L<TFBuffer|AI::TensorFlow::Libtensorflow::Lib::Types/TFBuffer>
Contains a copy of the input data from C<$proto>.
=back
B<C API>: L<< C<TF_NewBufferFromString>|AI::TensorFlow::Libtensorflow::Manual::CAPI/TF_NewBufferFromString >>
=head1 ATTRIBUTES
=head2 data
An C<opaque> pointer to the buffer.
=head2 length
Length of the buffer as a C<size_t>.
=head2 data_deallocator
A C<CodeRef> for the deallocator.
=head1 DESTRUCTORS
=head2 DESTROY
B<C API>: L<< C<TF_DeleteBuffer>|AI::TensorFlow::Libtensorflow::Manual::CAPI/TF_DeleteBuffer >>
=head1 AUTHOR
Zakariyya Mughal <zmughal@cpan.org>
=head1 COPYRIGHT AND LICENSE
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
=cut
( run in 1.703 second using v1.01-cache-2.11-cpan-5b529ec07f3 )