torch_geometric.data.TensorAttr

class TensorAttr(group_name: Optional[str] = _FieldStatus.UNSET, attr_name: Optional[str] = _FieldStatus.UNSET, index: Optional[Union[Tensor, ndarray, slice, int]] = _FieldStatus.UNSET)[source]

基础类:CastMixin

定义了一个FeatureStore张量的属性。 它包含了从FeatureStore中唯一识别一个张量所需的所有参数。

请注意,属性的顺序很重要;这是索引调用时必须提供属性的顺序。FeatureStore 实现可以通过重写TensorAttr.__init__()来定义不同的顺序。

is_set(key: str) bool[source]

是否在TensorAttr中设置了属性。

Return type:

bool 翻译后的内容: bool 在这个例子中,`bool` 是一个Python函数名称,根据翻译规则1,不需要翻译。因此,翻译后的内容保持不变。

is_fully_specified() bool[source]

是否TensorAttr没有未设置的字段。

Return type:

bool 翻译后的内容: bool 在这个例子中,`bool` 是一个Python函数名称,根据翻译规则1,不需要翻译。因此,翻译后的内容保持不变。

update(attr: TensorAttr) TensorAttr[source]

使用另一个TensorAttr中的设置属性更新TensorAttr

Return type:

TensorAttr