- Notifications
You must be signed in to change notification settings - Fork 579
RFC: Functions, not sessions in 2.0 #20
RFC: Functions, not sessions in 2.0 #20
Conversation
| For python 3 users, it would be nice if instead of specifying expected types and shapes as an argument to we could write While this could not be used in tensorflow itself (unless there was a build step that when targeting py2 would convert the latter into the former), but would give projects not concerned with backward compatibility a nicer syntax, and give linters the ability to detect some API misuses before the program is run. |
| Definitely prefer |
| It also makes sense to have |
| Strongly agree with Looking at common python decorators, I find the most clear decorators use either:
|
| Separately, will we need to handle Related to tensorflow/tensorflow#10282 |
| How does this interact with device selection? I.e. the different f's have the same signature here, but to execute them on different devices we need to different graphs. |
| At a high level, I really like the idea to push towards a more functional/composable API. For me, having to figure out a clean way to reuse components of a graph while passing in different inputs (e.g. dataset inputs during training, then export a graph with placeholders for inference) has always been an annoyance. I will likely have more comments (currently traveling and have limited time to type things up), but I had a couple of concerns I want to bring up:
|
| @samjabrahams , thanks for the comments. Some responses:
|
| @ngc92 , re #20 (comment) - yes, different graphs will be created for those. This happens with |
(Prototyped in tensorflow/tensorflow@84ace03)
(In the spirit of tensorflow/community#20) PiperOrigin-RevId: 217627136
| asimshankar could you please post the notes from the design review meeting into this thread ? also, are there any updates to this document? once both those are resolved we can proceed to merge this. |
| @goldiegadde : I updated the document in place based on the meeting notes. |
Thanks @asimshankar . Can you push a version of the doc with Status as "Accepted". We can then proceed to merge it. |
| @goldiegadde : Done. Thanks. |
| Thanks everyone for reviewing the RFC. I am going to merge this request now. |
Review period closes 2018-10-04
Functions, not sessions in 2.0
Proposal to make TensorFlow be more "Pythonic" in 2.0. In four bullet points:
(where the graph is executed when the function is invoked, instead of via Session)