-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to convert Tensor to String representation #268
Comments
Looks good, are you planning on making a PR for this? If so, some initial comments:
|
@rnett Good suggestions. I'll try to formulate a PR. Question though, since this method is meant strictly for debugging, couldn't we implement it for non-eager sessions as well? We could spin up a graph runner, evaluate the operand, and return the String representation. |
You could, but if that tensor depends on anything non-constant (i.e. placeholders or variables), you won't be able to get it, since the session has no way of knowing about those inputs. And I would think most things you want to debug would have dependencies like that. Plus I'm not sure sessions support adding things to the graph after the session is created, and you'd have to re-run the whole graph each time you called asString. Once we finish functions and eager gradients, most debugging should be done in eager mode anyways. You'd almost always use functions instead of graphs, and there would be a global "execute functions in eager mode" like in Python. It's not necessarily impossible to have asString in graph mode, but it's not easy and won't ever fit very well, and since we have this coming I don't think it's worth it. Feel free to come up with an implementation and make a PR, but maybe PR just the eager version first. |
Per our discussion on Gitter, here is a possible implementation for converting Tensors to a String representation. It is still missing some important features, like collapsing long arrays using ellipses, but this can serve as a stepping stone. The functionality is meant to ease troubleshooting/debugging so performance should not be an issue.
The text was updated successfully, but these errors were encountered: