Class Tensor¶
Defined in File TensorBody.h
Page Contents
Class Documentation¶
-
class Tensor : public TensorBase¶
Public Types
Public Functions
-
Tensor() = default¶
-
inline explicit Tensor(c10::intrusive_ptr<TensorImpl, UndefinedTensorImpl> tensor_impl)¶
-
inline explicit Tensor(const TensorBase &base)¶
-
inline Tensor(TensorBase &&base)¶
-
inline c10::MaybeOwned<Tensor> expect_contiguous(MemoryFormat memory_format = MemoryFormat::Contiguous) const &¶
Should be used if *this can reasonably be expected to be contiguous and performance is important.
Compared to contiguous, it saves a reference count increment/decrement if *this is already contiguous, at the cost in all cases of an extra pointer of stack usage, an extra branch to access, and an extra branch at destruction time.
-
c10::MaybeOwned<Tensor> expect_contiguous(MemoryFormat memory_format = MemoryFormat::Contiguous) && = delete¶
- inline C10_DEPRECATED_MESSAGE ("Tensor.type() is deprecated. Instead use Tensor.options(), which in many cases (e.g. in a constructor) is a drop-in replacement. If you were using data from type(), that is now available from Tensor itself, so instead of tensor.type().scalar_type(), use tensor.scalar_type() instead and instead of tensor.type().backend() use tensor.device().") DeprecatedTypeProperties &type() const
- inline C10_DEPRECATED_MESSAGE ("Tensor.is_variable() is deprecated; everything is a variable now. (If you want to assert that variable has been appropriately handled already, use at::impl::variable_excluded_from_dispatch())") bool is_variable() const noexcept
- template<typename T> inline C10_DEPRECATED_MESSAGE ("Tensor.data<T>() is deprecated. Please use Tensor.data_ptr<T>() instead.") T *data() const
- template<typename T, size_t N, template< typename U > class PtrTraits = DefaultPtrTraits, typename index_t = int64_t> C10_DEPRECATED_MESSAGE ("packed_accessor is deprecated, use packed_accessor32 or packed_accessor64 instead") GenericPackedTensorAccessor< T
-
inline index_t packed_accessor() const &¶
- template<typename T, size_t N, template< typename U > class PtrTraits = DefaultPtrTraits, typename index_t = int64_t> C10_DEPRECATED_MESSAGE ("packed_accessor is deprecated, use packed_accessor32 or packed_accessor64 instead") GenericPackedTensorAccessor< T
-
index_t packed_accessor() && = delete¶
-
inline void backward(const Tensor &gradient = {}, c10::optional<bool> retain_graph = c10::nullopt, bool create_graph = false, c10::optional<TensorList> inputs = c10::nullopt) const¶
Computes the gradient of current tensor with respect to graph leaves.
The graph is differentiated using the chain rule. If the tensor is non-scalar (i.e. its data has more than one element) and requires gradient, the function additionally requires specifying
gradient
. It should be a tensor of matching type and location, that contains the gradient of the differentiated function w.r.t. this Tensor.This function accumulates gradients in the leaves - you might need to zero them before calling it.
- Parameters
gradient – Gradient w.r.t. the tensor. If it is a tensor, it will be automatically converted to a Tensor that does not require grad unless
create_graph
is True. None values can be specified for scalar Tensors or ones that don’t require grad. If a None value would be acceptable then this argument is optional.retain_graph – If
false
, the graph used to compute the grads will be freed. Note that in nearly all cases setting this option to True is not needed and often can be worked around in a much more efficient way. Defaults to the value ofcreate_graph
.create_graph – If
true
, graph of the derivative will be constructed, allowing to compute higher order derivative products. Defaults tofalse
.inputs – Inputs w.r.t. which the gradient will be accumulated into
at::Tensor::grad
. All other Tensors will be ignored. If not provided, the gradient is accumulated into all the leaf Tensors that were used to compute the current tensor. When inputs are provided and a given input is not a leaf, the current implementation will call its grad_fn (even though it is not strictly needed to get this gradients). It is an implementation detail on which the user should not rely. See https://github.com/pytorch/pytorch/pull/60521#issuecomment-867061780 for more details.
-
inline Tensor &mutable_grad() const¶
Return a mutable reference to the gradient.
This is conventionally used as
t.grad() = x
to set a gradient to a completely new tensor. Note that this function work with a non-const Tensor and is not thread safe.
-
inline const Tensor &grad() const¶
This function returns an undefined tensor by default and returns a defined tensor the first time a call to
backward()
computes gradients for this Tensor.The attribute will then contain the gradients computed and future calls to
backward()
will accumulate (add) gradients into it.
-
inline const Tensor &_fw_grad(uint64_t level) const¶
This function returns the forward gradient for this Tensor at the given level.
-
inline void _set_fw_grad(const TensorBase &new_grad, uint64_t level, bool is_inplace_op) const¶
This function can be used to set the value of the forward grad.
Note that the given new_grad might not be used directly if it has different metadata (size/stride/storage offset) compared to this Tensor. In that case, new_grad content will be copied into a new Tensor
-
inline void __dispatch__backward(at::TensorList inputs, const c10::optional<at::Tensor> &gradient = {}, c10::optional<bool> retain_graph = c10::nullopt, bool create_graph = false) const¶
-
inline bool __dispatch_is_leaf() const¶
-
inline int64_t __dispatch_output_nr() const¶
-
inline int64_t __dispatch__version() const¶
-
inline void __dispatch_retain_grad() const¶
-
inline bool __dispatch_retains_grad() const¶
-
inline at::Tensor addmv(const at::Tensor &mat, const at::Tensor &vec, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline at::Tensor &addmv_(const at::Tensor &mat, const at::Tensor &vec, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline at::Tensor addr(const at::Tensor &vec1, const at::Tensor &vec2, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline at::Tensor &addr_(const at::Tensor &vec1, const at::Tensor &vec2, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline bool allclose(const at::Tensor &other, double rtol = 1e-05, double atol = 1e-08, bool equal_nan = false) const¶
-
inline at::Tensor as_strided(at::IntArrayRef size, at::IntArrayRef stride, c10::optional<int64_t> storage_offset = c10::nullopt) const¶
-
inline at::Tensor as_strided_symint(c10::SymIntArrayRef size, c10::SymIntArrayRef stride, c10::optional<c10::SymInt> storage_offset = c10::nullopt) const¶
-
inline const at::Tensor &as_strided_(at::IntArrayRef size, at::IntArrayRef stride, c10::optional<int64_t> storage_offset = c10::nullopt) const¶
-
inline const at::Tensor &as_strided__symint(c10::SymIntArrayRef size, c10::SymIntArrayRef stride, c10::optional<c10::SymInt> storage_offset = c10::nullopt) const¶
-
inline at::Tensor baddbmm(const at::Tensor &batch1, const at::Tensor &batch2, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline at::Tensor &baddbmm_(const at::Tensor &batch1, const at::Tensor &batch2, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline at::Tensor &bernoulli_(const at::Tensor &p, c10::optional<at::Generator> generator = c10::nullopt) const¶
-
inline at::Tensor &bernoulli_(double p = 0.5, c10::optional<at::Generator> generator = c10::nullopt) const¶
-
inline at::Tensor bincount(const c10::optional<at::Tensor> &weights = {}, int64_t minlength = 0) const¶
-
inline ::std::vector<at::Tensor> tensor_split_symint(c10::SymIntArrayRef indices, int64_t dim = 0) const¶
-
inline ::std::vector<at::Tensor> tensor_split(const at::Tensor &tensor_indices_or_sections, int64_t dim = 0) const¶
-
inline at::Tensor clamp(const c10::optional<at::Scalar> &min, const c10::optional<at::Scalar> &max = c10::nullopt) const¶
-
inline at::Tensor clamp(const c10::optional<at::Tensor> &min = {}, const c10::optional<at::Tensor> &max = {}) const¶
-
inline at::Tensor &clamp_(const c10::optional<at::Scalar> &min, const c10::optional<at::Scalar> &max = c10::nullopt) const¶
-
inline at::Tensor &clamp_(const c10::optional<at::Tensor> &min = {}, const c10::optional<at::Tensor> &max = {}) const¶
-
inline at::Tensor clip(const c10::optional<at::Scalar> &min, const c10::optional<at::Scalar> &max = c10::nullopt) const¶
-
inline at::Tensor clip(const c10::optional<at::Tensor> &min = {}, const c10::optional<at::Tensor> &max = {}) const¶
-
inline at::Tensor &clip_(const c10::optional<at::Scalar> &min, const c10::optional<at::Scalar> &max = c10::nullopt) const¶
-
inline at::Tensor &clip_(const c10::optional<at::Tensor> &min = {}, const c10::optional<at::Tensor> &max = {}) const¶
-
inline at::Tensor __dispatch_contiguous(at::MemoryFormat memory_format = MemoryFormat::Contiguous) const¶
-
inline at::Tensor cov(int64_t correction = 1, const c10::optional<at::Tensor> &fweights = {}, const c10::optional<at::Tensor> &aweights = {}) const¶
-
inline at::Tensor cumprod(at::Dimname dim, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor &cumprod_(at::Dimname dim, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor cumsum(at::Dimname dim, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor &cumsum_(at::Dimname dim, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor diagonal(at::Dimname outdim, at::Dimname dim1, at::Dimname dim2, int64_t offset = 0) const¶
-
inline at::Tensor diff(int64_t n = 1, int64_t dim = -1, const c10::optional<at::Tensor> &prepend = {}, const c10::optional<at::Tensor> &append = {}) const¶
-
inline at::Tensor div(const at::Tensor &other, c10::optional<c10::string_view> rounding_mode) const¶
-
inline at::Tensor &div_(const at::Tensor &other, c10::optional<c10::string_view> rounding_mode) const¶
-
inline at::Tensor div(const at::Scalar &other, c10::optional<c10::string_view> rounding_mode) const¶
-
inline at::Tensor &div_(const at::Scalar &other, c10::optional<c10::string_view> rounding_mode) const¶
-
inline at::Tensor divide(const at::Tensor &other, c10::optional<c10::string_view> rounding_mode) const¶
-
inline at::Tensor ÷_(const at::Tensor &other, c10::optional<c10::string_view> rounding_mode) const¶
-
inline at::Tensor divide(const at::Scalar &other, c10::optional<c10::string_view> rounding_mode) const¶
-
inline at::Tensor ÷_(const at::Scalar &other, c10::optional<c10::string_view> rounding_mode) const¶
-
inline at::Tensor new_empty(at::IntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_empty_symint(c10::SymIntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_empty_strided(at::IntArrayRef size, at::IntArrayRef stride, at::TensorOptions options = {}) const¶
-
inline at::Tensor new_empty_strided(at::IntArrayRef size, at::IntArrayRef stride, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_empty_strided_symint(c10::SymIntArrayRef size, c10::SymIntArrayRef stride, at::TensorOptions options = {}) const¶
-
inline at::Tensor new_empty_strided_symint(c10::SymIntArrayRef size, c10::SymIntArrayRef stride, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_full(at::IntArrayRef size, const at::Scalar &fill_value, at::TensorOptions options = {}) const¶
-
inline at::Tensor new_full(at::IntArrayRef size, const at::Scalar &fill_value, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_full_symint(c10::SymIntArrayRef size, const at::Scalar &fill_value, at::TensorOptions options = {}) const¶
-
inline at::Tensor new_full_symint(c10::SymIntArrayRef size, const at::Scalar &fill_value, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_zeros(at::IntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_zeros_symint(c10::SymIntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_ones(at::IntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline at::Tensor new_ones_symint(c10::SymIntArrayRef size, c10::optional<at::ScalarType> dtype, c10::optional<at::Layout> layout, c10::optional<at::Device> device, c10::optional<bool> pin_memory) const¶
-
inline const at::Tensor &resize_(at::IntArrayRef size, c10::optional<at::MemoryFormat> memory_format = c10::nullopt) const¶
-
inline const at::Tensor &resize__symint(c10::SymIntArrayRef size, c10::optional<at::MemoryFormat> memory_format = c10::nullopt) const¶
-
inline at::Tensor unflatten_symint(at::Dimname dim, c10::SymIntArrayRef sizes, at::DimnameList names) const¶
-
inline at::Tensor &index_copy_(int64_t dim, const at::Tensor &index, const at::Tensor &source) const¶
-
inline at::Tensor &index_copy_(at::Dimname dim, const at::Tensor &index, const at::Tensor &source) const¶
-
inline at::Tensor index_copy(at::Dimname dim, const at::Tensor &index, const at::Tensor &source) const¶
-
inline at::Tensor &index_put_(const c10::List<c10::optional<at::Tensor>> &indices, const at::Tensor &values, bool accumulate = false) const¶
-
inline at::Tensor index_put(const c10::List<c10::optional<at::Tensor>> &indices, const at::Tensor &values, bool accumulate = false) const¶
-
inline at::Tensor isclose(const at::Tensor &other, double rtol = 1e-05, double atol = 1e-08, bool equal_nan = false) const¶
-
inline bool is_distributed() const¶
-
inline bool __dispatch_is_floating_point() const¶
-
inline bool __dispatch_is_complex() const¶
-
inline bool __dispatch_is_conj() const¶
-
inline bool __dispatch__is_zerotensor() const¶
-
inline bool __dispatch_is_neg() const¶
-
inline bool is_nonzero() const¶
-
inline bool __dispatch_is_signed() const¶
-
inline bool __dispatch_is_inference() const¶
-
inline ::std::tuple<at::Tensor, at::Tensor> kthvalue(int64_t k, int64_t dim = -1, bool keepdim = false) const¶
-
inline ::std::tuple<at::Tensor, at::Tensor> kthvalue(int64_t k, at::Dimname dim, bool keepdim = false) const¶
-
inline at::Tensor nan_to_num(c10::optional<double> nan = c10::nullopt, c10::optional<double> posinf = c10::nullopt, c10::optional<double> neginf = c10::nullopt) const¶
-
inline at::Tensor &nan_to_num_(c10::optional<double> nan = c10::nullopt, c10::optional<double> posinf = c10::nullopt, c10::optional<double> neginf = c10::nullopt) const¶
-
inline at::Tensor log_softmax(int64_t dim, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor log_softmax(at::Dimname dim, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline ::std::tuple<at::Tensor, at::Tensor> aminmax(c10::optional<int64_t> dim = c10::nullopt, bool keepdim = false) const¶
-
inline at::Tensor mean(at::OptionalIntArrayRef dim, bool keepdim = false, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor mean(at::DimnameList dim, bool keepdim = false, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor nanmean(at::OptionalIntArrayRef dim = c10::nullopt, bool keepdim = false, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor repeat_interleave(const at::Tensor &repeats, c10::optional<int64_t> dim = c10::nullopt, c10::optional<int64_t> output_size = c10::nullopt) const¶
-
inline at::Tensor repeat_interleave(int64_t repeats, c10::optional<int64_t> dim = c10::nullopt, c10::optional<int64_t> output_size = c10::nullopt) const¶
-
inline at::Tensor repeat_interleave_symint(c10::SymInt repeats, c10::optional<int64_t> dim = c10::nullopt, c10::optional<int64_t> output_size = c10::nullopt) const¶
-
inline at::Tensor _reshape_alias_symint(c10::SymIntArrayRef size, c10::SymIntArrayRef stride) const¶
-
inline at::Tensor detach() const¶
Returns a new Tensor, detached from the current graph.
The result will never require gradient.
-
inline at::Tensor &detach_() const¶
Detaches the Tensor from the graph that created it, making it a leaf.
Views cannot be detached in-place.
-
inline int64_t size(at::Dimname dim) const¶
-
inline at::Tensor slice(int64_t dim = 0, c10::optional<int64_t> start = c10::nullopt, c10::optional<int64_t> end = c10::nullopt, int64_t step = 1) const¶
-
inline at::Tensor slice_symint(int64_t dim = 0, c10::optional<c10::SymInt> start = c10::nullopt, c10::optional<c10::SymInt> end = c10::nullopt, c10::SymInt step = 1) const¶
-
inline at::Tensor slice_scatter(const at::Tensor &src, int64_t dim = 0, c10::optional<int64_t> start = c10::nullopt, c10::optional<int64_t> end = c10::nullopt, int64_t step = 1) const¶
-
inline at::Tensor slice_scatter_symint(const at::Tensor &src, int64_t dim = 0, c10::optional<c10::SymInt> start = c10::nullopt, c10::optional<c10::SymInt> end = c10::nullopt, c10::SymInt step = 1) const¶
-
inline at::Tensor select_scatter_symint(const at::Tensor &src, int64_t dim, c10::SymInt index) const¶
-
inline at::Tensor diagonal_scatter(const at::Tensor &src, int64_t offset = 0, int64_t dim1 = 0, int64_t dim2 = 1) const¶
-
inline at::Tensor as_strided_scatter(const at::Tensor &src, at::IntArrayRef size, at::IntArrayRef stride, c10::optional<int64_t> storage_offset = c10::nullopt) const¶
-
inline at::Tensor as_strided_scatter_symint(const at::Tensor &src, c10::SymIntArrayRef size, c10::SymIntArrayRef stride, c10::optional<c10::SymInt> storage_offset = c10::nullopt) const¶
-
inline at::Tensor softmax(at::Dimname dim, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline ::std::vector<at::Tensor> unsafe_split_symint(c10::SymInt split_size, int64_t dim = 0) const¶
-
inline ::std::vector<at::Tensor> split_symint(c10::SymIntArrayRef split_size, int64_t dim = 0) const¶
-
inline ::std::vector<at::Tensor> unsafe_split_with_sizes(at::IntArrayRef split_sizes, int64_t dim = 0) const¶
-
inline ::std::vector<at::Tensor> unsafe_split_with_sizes_symint(c10::SymIntArrayRef split_sizes, int64_t dim = 0) const¶
-
inline ::std::vector<at::Tensor> split_with_sizes(at::IntArrayRef split_sizes, int64_t dim = 0) const¶
-
inline ::std::vector<at::Tensor> split_with_sizes_symint(c10::SymIntArrayRef split_sizes, int64_t dim = 0) const¶
-
inline at::Tensor sspaddmm(const at::Tensor &mat1, const at::Tensor &mat2, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline at::Tensor stft(int64_t n_fft, c10::optional<int64_t> hop_length, c10::optional<int64_t> win_length, const c10::optional<at::Tensor> &window, bool normalized, c10::optional<bool> onesided = c10::nullopt, c10::optional<bool> return_complex = c10::nullopt) const¶
-
inline at::Tensor stft(int64_t n_fft, c10::optional<int64_t> hop_length = c10::nullopt, c10::optional<int64_t> win_length = c10::nullopt, const c10::optional<at::Tensor> &window = {}, bool center = true, c10::string_view pad_mode = "reflect", bool normalized = false, c10::optional<bool> onesided = c10::nullopt, c10::optional<bool> return_complex = c10::nullopt) const¶
-
inline at::Tensor istft(int64_t n_fft, c10::optional<int64_t> hop_length = c10::nullopt, c10::optional<int64_t> win_length = c10::nullopt, const c10::optional<at::Tensor> &window = {}, bool center = true, bool normalized = false, c10::optional<bool> onesided = c10::nullopt, c10::optional<int64_t> length = c10::nullopt, bool return_complex = false) const¶
-
inline int64_t stride(at::Dimname dim) const¶
-
inline at::Tensor sum(at::OptionalIntArrayRef dim, bool keepdim = false, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor sum(at::DimnameList dim, bool keepdim = false, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor nansum(at::OptionalIntArrayRef dim = c10::nullopt, bool keepdim = false, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor std(at::OptionalIntArrayRef dim = c10::nullopt, const c10::optional<at::Scalar> &correction = c10::nullopt, bool keepdim = false) const¶
-
inline at::Tensor std(at::DimnameList dim, const c10::optional<at::Scalar> &correction = c10::nullopt, bool keepdim = false) const¶
-
inline at::Tensor prod(int64_t dim, bool keepdim = false, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor prod(at::Dimname dim, bool keepdim = false, c10::optional<at::ScalarType> dtype = c10::nullopt) const¶
-
inline at::Tensor var(at::OptionalIntArrayRef dim = c10::nullopt, const c10::optional<at::Scalar> &correction = c10::nullopt, bool keepdim = false) const¶
-
inline at::Tensor var(at::DimnameList dim, const c10::optional<at::Scalar> &correction = c10::nullopt, bool keepdim = false) const¶
-
inline at::Tensor norm(const c10::optional<at::Scalar> &p, at::IntArrayRef dim, bool keepdim, at::ScalarType dtype) const¶
-
inline at::Tensor norm(const c10::optional<at::Scalar> &p, at::IntArrayRef dim, bool keepdim = false) const¶
-
inline at::Tensor norm(const c10::optional<at::Scalar> &p, at::DimnameList dim, bool keepdim, at::ScalarType dtype) const¶
-
inline at::Tensor norm(const c10::optional<at::Scalar> &p, at::DimnameList dim, bool keepdim = false) const¶
-
inline const at::Tensor &resize_as_(const at::Tensor &the_template, c10::optional<at::MemoryFormat> memory_format = c10::nullopt) const¶
-
inline at::Tensor addmm(const at::Tensor &mat1, const at::Tensor &mat2, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline at::Tensor &addmm_(const at::Tensor &mat1, const at::Tensor &mat2, const at::Scalar &beta = 1, const at::Scalar &alpha = 1) const¶
-
inline at::Tensor _addmm_activation(const at::Tensor &mat1, const at::Tensor &mat2, const at::Scalar &beta = 1, const at::Scalar &alpha = 1, bool use_gelu = false) const¶
-
inline const at::Tensor &sparse_resize_(at::IntArrayRef size, int64_t sparse_dim, int64_t dense_dim) const¶
-
inline const at::Tensor &sparse_resize_and_clear_(at::IntArrayRef size, int64_t sparse_dim, int64_t dense_dim) const¶
-
inline at::Tensor _sparse_mask_projection(const at::Tensor &mask, bool accumulate_matches = false) const¶
-
inline at::Tensor to_dense(c10::optional<at::ScalarType> dtype = c10::nullopt, c10::optional<bool> masked_grad = c10::nullopt) const¶
-
inline at::Tensor _to_dense(c10::optional<at::ScalarType> dtype = c10::nullopt, c10::optional<bool> masked_grad = c10::nullopt) const¶
-
inline int64_t sparse_dim() const¶
-
inline int64_t _dimI() const¶
-
inline int64_t dense_dim() const¶
-
inline int64_t _dimV() const¶
-
inline int64_t _nnz() const¶
-
inline bool is_coalesced() const¶
- inline ::std::vector<at::Tensor<
-
Tensor() = default¶