AI-TensorFlow-Libtensorflow
view release on metacpan or search on metacpan
Makefile.PL view on Meta::CPAN
"constant" => 0,
"feature" => 0,
"lib" => 0,
"namespace::autoclean" => 0,
"overload" => 0,
"strict" => 0,
"warnings" => 0
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
lib/AI/TensorFlow/Libtensorflow/Manual/CAPI.pod view on Meta::CPAN
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT extern void TF_DeleteFunction(TF_Function* func);
=head2 TF_TryEvaluateConstant
=over 2
Attempts to evaluate `output`. This will only be possible if `output` doesn't
depend on any graph inputs (this function is safe to call if this isn't the
case though).
If the evaluation is successful, this function returns true and `output`s
value is returned in `result`. Otherwise returns false. An error status is
returned if something is wrong with the graph or input. Note that this may
return false even if no error status is set.
=back
/* From <tensorflow/c/c_api.h> */
TF_CAPI_EXPORT extern unsigned char TF_TryEvaluateConstant(TF_Graph* graph,
TF_Output output,
TF_Tensor** result,
lib/AI/TensorFlow/Libtensorflow/Manual/Notebook/InferenceUsingTFHubEnformerGeneExprPredModel.pod view on Meta::CPAN
my $from_alphabet = "NACGT";
my $to_alphabet = pack "C*", 0..length($from_alphabet)-1;
# sequences from UCSC genome have both uppercase and lowercase bases
my $from_alphabet_tr = $from_alphabet . lc $from_alphabet;
my $to_alphabet_tr = $to_alphabet x 2;
my $p = zeros(byte, bytes::length($seq));
my $p_dataref = $p->get_dataref;
${ $p_dataref } = $seq;
eval "tr/$from_alphabet_tr/$to_alphabet_tr/" for ${ $p_dataref };
$p->upd_data;
my $encoder = append(float(0), identity(float(length($from_alphabet)-1)) );
say "Encoder is\n", $encoder->info, $encoder if $SHOW_ENCODER;
my $encoded = $encoder->index( $p->dummy(0) );
return $encoded;
}
lib/AI/TensorFlow/Libtensorflow/Manual/Notebook/InferenceUsingTFHubEnformerGeneExprPredModel.pod view on Meta::CPAN
my $from_alphabet = "NACGT";
my $to_alphabet = pack "C*", 0..length($from_alphabet)-1;
# sequences from UCSC genome have both uppercase and lowercase bases
my $from_alphabet_tr = $from_alphabet . lc $from_alphabet;
my $to_alphabet_tr = $to_alphabet x 2;
my $p = zeros(byte, bytes::length($seq));
my $p_dataref = $p->get_dataref;
${ $p_dataref } = $seq;
eval "tr/$from_alphabet_tr/$to_alphabet_tr/" for ${ $p_dataref };
$p->upd_data;
my $encoder = append(float(0), identity(float(length($from_alphabet)-1)) );
say "Encoder is\n", $encoder->info, $encoder if $SHOW_ENCODER;
my $encoded = $encoder->index( $p->dummy(0) );
return $encoded;
}
lib/AI/TensorFlow/Libtensorflow/Tensor.pm view on Meta::CPAN
$ffi->attach( [ 'TensorMaybeMove' => 'MaybeMove' ] =>
[ arg 'TF_Tensor' => 'self' ],
=> 'TF_Tensor',
);
$ffi->attach( ['TensorIsAligned' => 'IsAligned'] => [
arg TF_Tensor => 't'
] => 'bool' );
eval {# TF v2.10.0
$ffi->attach( [ 'SetShape' => 'SetShape' ] =>
[
arg 'TF_Tensor' => 'self',
arg 'tf_dims_buffer' => [ qw(dims num_dims) ],
]
=> 'void'
);
};
$ffi->attach( [ 'TensorBitcastFrom' => 'BitcastFrom' ] => [
maint/inc/Pod/Elemental/Transformer/TF_Sig.pm view on Meta::CPAN
around __paras_for_def_marker => sub {
my ($orig, $self, $rest) = @_;
my $ffi = AI::TensorFlow::Libtensorflow::Lib->ffi;
my $type_library = 'AI::TensorFlow::Libtensorflow::Lib::Types';
my @types = ($rest);
my $process_type = sub {
my ($type) = @_;
my $new_type_text = $type;
my $info;
if( eval { $info->{TT} = t($type); 1 }
|| eval { $info->{FFI} = $ffi->type_meta($type); 1 } ) {
if( $info->{TT} && $info->{TT}->library eq $type_library ) {
$new_type_text = "L<$type|$type_library/$type>";
}
} else {
die "Could not find type constraint or FFI::Platypus type $type";
}
$new_type_text;
};
xt/author/pod-snippets.t view on Meta::CPAN
package # hide from PAUSE
Test::Pod::Snippets::Role::PodLocatable {
use Moose::Role;
use Pod::Simple::Search;
around _parse => sub {
my $orig = shift;
my ($self, $type, $input) = @_;
my $output = eval { $orig->(@_); };
my $error = $@;
if( $error =~ /not found in \@INC/ && $type eq 'module' ) {
my $pod_file = Pod::Simple::Search->new->find($input);
if( -f $pod_file ) {
return $orig->($self, 'file', $pod_file )
} else {
die "$error\nUnable to find POD file for $input\n";
}
}
( run in 1.874 second using v1.01-cache-2.11-cpan-98e64b0badf )