37 { a.as_tensor_size() };
50template <
typename real_t,
short_t GeoDim,
short_t ParDim>
class BSplinePatch {
56 virtual torch::Device
device() const noexcept = 0;
92 virtual utils::BlockTensor<
torch::Tensor, 1, GeoDim>
94 const
torch::Tensor &coeff_indices, int64_t numeval,
95 torch::IntArrayRef sizes) const = 0;
97 virtual utils::BlockTensor<
torch::Tensor, 1, GeoDim>
99 const
torch::Tensor &coeff_indices, int64_t numeval,
100 torch::IntArrayRef sizes) const = 0;
111operator<<(
std::ostream &os, const
BSplinePatch<real_t, GeoDim, ParDim> &obj) {
112 obj.pretty_print(os);
Compile-time block tensor.
Abstract patch function base class.
Definition patch.hpp:50
virtual torch::Layout layout() const noexcept=0
Returns the layout property.
virtual bool pinned_memory() const noexcept=0
Returns the pinned_memory property.
virtual torch::Tensor as_tensor() const noexcept=0
virtual int32_t device_index() const noexcept=0
Returns the device_index property.
virtual bool requires_grad() const noexcept=0
Returns the requires_grad property.
virtual torch::Dtype dtype() const noexcept=0
Returns the dtype property.
virtual BSplinePatch & set_requires_grad(bool requires_grad) noexcept=0
Sets the B-spline object's requires_grad property.
virtual BSplinePatch & from_tensor(const torch::Tensor &tensor) noexcept=0
Sets all coefficients from a single tensor.
virtual bool is_sparse() const noexcept=0
Returns if the layout is sparse.
virtual ~BSplinePatch()=default
Destructor.
virtual int64_t as_tensor_size() const noexcept=0
Returns the size of the single tensor representation of all coefficients.
virtual void pretty_print(std::ostream &os=Log(log::info)) const noexcept=0
Returns a string representation.
virtual utils::BlockTensor< torch::Tensor, 1, GeoDim > eval_from_precomputed(const torch::Tensor &basfunc, const torch::Tensor &coeff_indices, int64_t numeval, torch::IntArrayRef sizes) const =0
Returns the value of the spline function from precomputed basis function.
virtual torch::Device device() const noexcept=0
Returns the device property.
struct iganet::@0 Log
Logger.
log
Enumerator for specifying the logging level.
Definition core.hpp:90
short int short_t
Definition core.hpp:74
Definition optimizer.hpp:61
TensorArray utility functions.