kaolin.physics.simplicits.SkinnedPoints

API

class kaolin.physics.simplicits.SkinnedPoints(pts, skinning_weights, strict_checks=True)

Bases: SkinnedPointsProtocol, TensorContainerBase

Points with skinning properties.

pts

The skinned points, of shape \((N, 3)\) (in \(m\)).

Type

torch.Tensor

skinning_weights

The skinning weights of the points, of shape \((N, \text{num_handles})\).

Type

torch.Tensor

__init__(pts, skinning_weights, strict_checks=True)
as_dict(only_tensors=False) Dict[str, Any]

Return all non-None attributes as a {name: value} dict.

classmethod assert_supported(attr)

Raises an exception if class does not support provided attribute name.

check_other_attribute(attr, log_error=False)

Checks a non-tensor attribute validity; returns True if ok.

check_sanity(log_error=True)

Validates that all tensor attributes are correct; implement abstract methods.

Parameters

log_error (bool) – If True, logs each failed check via logger.error.

Returns

True if all checks pass, False otherwise.

Return type

bool

check_tensor_attribute(attr, log_error=False)

Checks tensor attribute validity; returns True if valid.

classmethod class_other_attributes()

Returns attribute names that are not PyTorch tensors or dicts thereof.

classmethod class_tensor_attributes()

Returns attribute names that are PyTorch tensors or dicts thereof.

cpu(attributes: Optional[Sequence[str]] = None)

Calls cpu on all or selected tensor attributes; returns a shallow copy.

cuda(device: Optional[Union[int, device, str]] = None, attributes: Optional[Sequence[str]] = None)

Calls cuda on all or selected tensor attributes; returns a shallow copy.

describe_attribute(attr, print_stats=False, detailed=False)

Outputs an informative string about an attribute; the same method used for all attributes in to_string.

Parameters
  • attr (str) – attribute name

  • print_stats (bool) – if to print statistics about values in each tensor

  • detailed (bool) – if to include additional information about each tensor

Returns

multi-line string with attribute information

Return type

(str)

Raises

ValueError if attr is not supported

detach(attributes: Optional[Sequence[str]] = None)

Detaches all or selected tensor attributes; returns a shallow copy.

classmethod from_skinning_mod(pts: Tensor, skinning_mod: SkinningModule)

Constructor from a SkinningModule to be applied on the points.

Parameters
  • pts (torch.Tensor) – The points to be skinned, of shape \((N, 3)\) (in \(m\))

  • skinning_mod (SkinningModule) – The SkinningModule to be used to compute the skinning weights.

get_attributes(only_tensors=False)

Returns names of all attributes that are currently set to non-None value in this class instance.

Parameters

only_tensors – if true, will only include tensor attributes

Returns

list of string names

Return type

(list)

property num_handles

Last dimension of the skinning weights

to(*args: Any, attributes: Optional[Sequence[str]] = None, **kwargs: Any)

Moves or casts tensors like torch.Tensor.to() / torch.nn.Module.to().

Parameters
  • *args – forwarded to tensor.to(*args)

  • attributes (list of str, optional) – if set, only these tensor attributes are updated

  • **kwargs – forwarded to tensor.to(**kwargs)

Returns

shallow copy with converted tensors

Return type

PointSamples

to_string(print_stats=False, detailed=False)

Returns information about tensor attributes currently contained in the object.

Parameters
  • print_stats (bool) – if to print statistics about values in each tensor

  • detailed (bool) – if to include additional information about each tensor

Returns

multi-line string with attribute information

Return type

(str)