diff options
author | 2018-09-21 03:54:43 -0700 | |
---|---|---|
committer | 2018-09-21 03:59:07 -0700 | |
commit | 200b89761a4665e3de6d0efc4e3e10ab287ad81b (patch) | |
tree | 01f5e4d091c227c7de8c813e55f5ed3e5f63bf85 /tensorflow/python/autograph | |
parent | d1e9a1ed54cae9b0b10ab89c06d6d7f9b53af3a1 (diff) |
Added fetch support for attrs classes.
Given a class
@attr.s()
class SampleAttr(object):
field_1 = attr.ib()
field_2 = attr.ib()
we will be able to run
obj = SampleAttr(tensor_1, tensor_2)
session.run(obj) # equivalent with session.run([obj.field_1, obj.field_2])
Please note, this does not need nest flatten support (which is only relevant to the feed_dict argument).
Also, the information in __attrs_attrs__ is provided for extensions (as per the docs: http://www.attrs.org/en/stable/extending.html#extending-metadata) like this and is not an "implementation detail".
PiperOrigin-RevId: 213963978
Diffstat (limited to 'tensorflow/python/autograph')
0 files changed, 0 insertions, 0 deletions