_attr_extern [No Doc]¶
Documentation¶
-
class
treetensor.torch.
Tensor
(data, *args, constraint=None, **kwargs)[source]¶ -
_attr_extern
(name)[source]¶ - Overview:
External protected function for support the unfounded attributes. In FastTreeValue it is extended to support the access to values’ attribute.
- Arguments:
key (
str
): Attribute name.
- Returns:
return (:obj:): TreeValue of the values’ attribute.
- Example:
>>> class Container: >>> def __init__(self, value): >>> self.__value = value >>> >>> @property >>> def value(self): >>> return self.__value >>> >>> def append(self, v): >>> return self.__value + v >>> >>> t = FastTreeValue({'a': Container(1), 'b': Container(2)}) >>> t.value # FastTreeValue({'a': 1, 'b': 2}) >>> t.append # FastTreeValue({'a': <method 'append' of Container(1)>, 'b': <method 'append' of Container(2)>})
-
No Documentation
No __doc__
is provided yet, need to be completed.