phlower.PhlowerTensor¶
- class phlower.PhlowerTensor(tensor, dimension_tensor=None, is_time_series=False, is_voxel=False)[source]¶
Bases:
IPhlowerTensor
Tensor object which can be with physics dimenstion tensor.
Methods
__init__
(tensor[, dimension_tensor, ...])as_pattern
(pattern)backward
()clone
()coalesce
()detach
()from_pattern
(tensor[, dimension_tensor, pattern])indices
()Returns the number of vertices.
numel
()numpy
()rank
()Returns the tensor rank.
rearrange
(pattern, **axes_length)reshape
(shape[, is_time_series, is_voxel])size
()to
([device, non_blocking, dtype])to_numpy
()to_tensor
()Convert to vertexwise 2D tensor which has (n_vertices, -1) shape.
transpose
(dim0, dim1)values
()Attributes
device
dimension
dtype
has_dimension
is_sparse
is_time_series
is_voxel
shape
shape_pattern
- Parameters:
tensor (torch.Tensor)
dimension_tensor (PhlowerDimensionTensor | None)
is_time_series (bool)
is_voxel (bool)