Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Activity for daniel_s‭

Type On... Excerpt Status Date
Edit Post #289625 Post edited:
about 1 year ago
Comment Post #289613 Yes. Tensorflow is intended to be executed on GPUs or TPUs, special hardware for doing calculations in parallel. The marker for executing it in parallel is the @tf.function decorator. Inside functions which have this decorator, (when executed on a GPU or TPU) you can't use all standard python modules...
(more)
about 1 year ago
Comment Post #289625 After more testing of lin_to_db I realized it doesn't work in all places with the pure tensorflow version, because it always returns a tf.Tensor, no matter if the input is a tf.Tensor or a float. But some subsequent code (in my case, json.dumps) can't handle tf.Tensor: TypeError: Object of type Eage...
(more)
about 1 year ago
Comment Post #289625 Cool, you're right, at least for lin_to_db I can indeed use just the tensorflow version. The other one is a bit more tricky, because I have variables which contain values that get written before graph execution and they get read during graph execution and afterwards. I don't want to duplicate them...
(more)
about 1 year ago
Edit Post #289625 Post edited:
about 1 year ago
Edit Post #289625 Initial revision about 1 year ago
Question Best practices to write functions for both execution modes in Tensorflow, eager and graph mode
I regularly run into the problem that I have a Python function that I want to use in both, eager and graph execution mode. I therefore have to adjust the code so that it can handle both situations. Here are two examples: ```python import tensorflow as tf ``` ```python def lintodb(x: float | tf...
(more)
about 1 year ago
Edit Post #289613 Initial revision about 1 year ago
Question Can't use tf.timestamp() from within @tf.function with XLA / jit_compile=True
I would like to use `tf.timestamp()` when it is available (eager mode and graph mode without XLA), and use `0.` (or a better fallback if there is one) when it is not available (with XLA; `@tf.function(jitcompile=True)`). I tried this: def tftimestamporzero(): try: retu...
(more)
about 1 year ago
Edit Post #289588 Post edited:
about 1 year ago
Edit Post #289588 Post edited:
about 1 year ago
Edit Post #289588 Post edited:
about 1 year ago
Edit Post #289588 Initial revision about 1 year ago
Question Is it okay to use python operators for tensorflow tensors?
TL;DR - Is `(a and b)` equivalent to `tf.logicaland(a, b)` in terms of optimization and performance? (`a` and `b` are tensorflow tensors) Details - I use Python with Tensorflow. My priorities are 1. Make the code run fast 2. Make it readable. I have working and fast code that, for my ...
(more)
about 1 year ago