r"""Applies the function :obj:`func` to all attributes :obj:`*keys`. If :obj:`*keys` is not given, :obj:`func` is applied to all present attributes.
(self, func, *keys)
| 102 | return self.cat_dim(key, value) |
| 103 | |
| 104 | def apply(self, func, *keys): |
| 105 | r"""Applies the function :obj:`func` to all attributes :obj:`*keys`. |
| 106 | If :obj:`*keys` is not given, :obj:`func` is applied to all present |
| 107 | attributes. |
| 108 | """ |
| 109 | for key, item in self(*keys): |
| 110 | if isinstance(item, Adjacency): |
| 111 | self[key] = func(item) |
| 112 | if not isinstance(item, torch.Tensor): |
| 113 | continue |
| 114 | self[key] = func(item) |
| 115 | return self |
| 116 | |
| 117 | def contiguous(self, *keys): |
| 118 | r"""Ensures a contiguous memory layout for all attributes :obj:`*keys`. |
no test coverage detected