Tensor

Struct Tensor 

Source
pub struct Tensor<T: Float> {
    pub data: ArrayD<T>,
    pub device: Device,
    pub requires_grad: bool,
}
Expand description

A multi-dimensional array that supports automatic differentiation. 自動微分をサポートする多次元配列

Fields§

§data: ArrayD<T>

The underlying n-dimensional array data 基底のn次元配列データ

§device: Device

Device where tensor is stored テンソルが保存されているデバイス

§requires_grad: bool

Whether tensor requires gradient computation テンソルが勾配計算を必要とするか

Implementations§

Source§

impl<T: Float + FromPrimitive + ScalarOperand + Send + Sync + 'static> Tensor<T>

Source

pub fn relu_fallback(&self) -> RusTorchResult<Tensor<T>>

CPU fallback ReLU implementation CPU フォールバック ReLU 実装

Source

pub fn sigmoid_fallback(&self) -> RusTorchResult<Tensor<T>>

CPU fallback Sigmoid implementation CPU フォールバック Sigmoid 実装

Source

pub fn softmax_fallback(&self, dim: isize) -> RusTorchResult<Tensor<T>>

CPU fallback Softmax implementation CPU フォールバック Softmax 実装

Source

pub fn gelu_fallback(&self) -> RusTorchResult<Tensor<T>>

CPU fallback GELU implementation CPU フォールバック GELU 実装

Source

pub fn leaky_relu_fallback( &self, negative_slope: f64, ) -> RusTorchResult<Tensor<T>>

CPU fallback Leaky ReLU implementation CPU フォールバック Leaky ReLU 実装

Source

pub fn elu_fallback(&self, alpha: f64) -> RusTorchResult<Tensor<T>>

CPU fallback ELU implementation CPU フォールバック ELU 実装

Source

pub fn swish_fallback(&self) -> RusTorchResult<Tensor<T>>

CPU fallback Swish implementation CPU フォールバック Swish 実装

Source

pub fn relu_metal(&self) -> RusTorchResult<Tensor<T>>

Source

pub fn sigmoid_metal(&self) -> RusTorchResult<Tensor<T>>

Source

pub fn tanh_metal(&self) -> RusTorchResult<Tensor<T>>

Source

pub fn gelu_metal(&self) -> RusTorchResult<Tensor<T>>

Source

pub fn leaky_relu_metal( &self, _negative_slope: f64, ) -> RusTorchResult<Tensor<T>>

Source

pub fn elu_metal(&self, _alpha: f64) -> RusTorchResult<Tensor<T>>

Source

pub fn swish_metal(&self) -> RusTorchResult<Tensor<T>>

Source§

impl<T: Float + FromPrimitive + ScalarOperand + Send + Sync + 'static> Tensor<T>

Source

pub fn conv_transpose2d_fallback( &self, _kernel: &Self, _params: &ConvolutionParams, ) -> RusTorchResult<Tensor<T>>

CPU fallback transpose convolution implementation CPU フォールバック転置畳み込み実装

Source

pub fn depthwise_conv2d_fallback( &self, _kernel: &Self, _params: &ConvolutionParams, ) -> RusTorchResult<Tensor<T>>

CPU fallback depthwise convolution implementation CPU フォールバック深度分離畳み込み実装

Source

pub fn grouped_conv2d_fallback( &self, _kernel: &Self, _params: &ConvolutionParams, _groups: usize, ) -> RusTorchResult<Tensor<T>>

CPU fallback grouped convolution implementation CPU フォールバック グループ畳み込み実装

Source

pub fn conv3d_fallback( &self, _kernel: &Self, _params: &ConvolutionParams, ) -> RusTorchResult<Tensor<T>>

CPU fallback 3D convolution implementation CPU フォールバック 3D 畳み込み実装

Source§

impl<T: Float + 'static> Tensor<T>

Source

pub fn new(data: ArrayD<T>) -> Self

Creates a new tensor from an array. 配列から新しいテンソルを作成します。

Source

pub fn new_with_options( data: ArrayD<T>, device: Device, requires_grad: bool, ) -> Self

Creates a new tensor with device and gradient settings デバイスと勾配設定付きで新しいテンソルを作成

Source

pub fn from_vec(data: Vec<T>, shape: Vec<usize>) -> Self

Creates a tensor from a vector and shape. ベクトルと形状からテンソルを作成します。

Source

pub fn from_vec_with_options( data: Vec<T>, shape: Vec<usize>, device: Device, requires_grad: bool, ) -> Self

Creates a tensor from a vector and shape with device and gradient settings デバイスと勾配設定付きでベクトルと形状からテンソルを作成

Source

pub fn try_from_vec(data: Vec<T>, shape: Vec<usize>) -> RusTorchResult<Self>

Creates a tensor from a vector and shape with error handling. エラーハンドリング付きでベクトルと形状からテンソルを作成します。

Source

pub fn as_ptr(&self) -> *const T

Get pointer address for unique identification ユニーク識別用のポインターアドレスを取得

Source

pub fn copy_from(&self, other: &Tensor<T>)

Copy data from another tensor (unsafe internal implementation) 別のテンソルからデータをコピー(unsafe内部実装)

Source

pub fn to_device(&self, _device: Arc<dyn GpuDevice>) -> Self

Convert tensor to different device (mock implementation) テンソルを別のデバイスに変換(モック実装)

Source

pub fn to_cpu(&self) -> Self

Convert tensor to CPU テンソルをCPUに変換

Source

pub fn auto_device(&self) -> Self

Automatically select the best device for this tensor operation このテンソル操作に最適なデバイスを自動選択

Source

pub fn try_to_gpu(&self) -> RusTorchResult<Self>

Try to move tensor to GPU with error handling エラーハンドリング付きでテンソルをGPUに移動を試行

Source

pub fn is_gpu_available(&self) -> bool

Check if GPU is available for this tensor このテンソルでGPUが利用可能かチェック

Source

pub fn device(&self) -> Device

Get the device where this tensor is stored このテンソルが保存されているデバイスを取得

Source

pub fn requires_grad(&self) -> bool

Check if tensor requires gradient computation テンソルが勾配計算を必要とするかチェック

Source

pub fn set_requires_grad(&mut self, requires_grad: bool) -> &mut Self

Set whether tensor requires gradient computation テンソルが勾配計算を必要とするかを設定

Source

pub fn with_device(&self, device: Device) -> Self

Move tensor to specified device type テンソルを指定デバイスタイプに移動

Source

pub fn device_type(&self) -> String

Get the current device type for this tensor このテンソルの現在のデバイスタイプを取得

Source

pub fn is_on_gpu(&self) -> bool

Check if tensor is on GPU テンソルがGPU上にあるかチェック

Source

pub fn is_cpu(&self) -> bool

Check if tensor is on CPU テンソルがCPU上にあるかチェック

Source

pub fn zeros(shape: &[usize]) -> Self

Creates a tensor filled with zeros. ゼロで満たされたテンソルを作成します。

Source

pub fn zeros_on_device(shape: &[usize], device: Device) -> Self

Creates a tensor filled with zeros on specified device 指定デバイス上でゼロで満たされたテンソルを作成

Source

pub fn try_zeros(shape: &[usize]) -> RusTorchResult<Self>

Creates a tensor filled with zeros with error handling. エラーハンドリング付きでゼロで満たされたテンソルを作成します。

Source

pub fn ones(shape: &[usize]) -> Self

Creates a tensor filled with ones. 1で満たされたテンソルを作成します。

Source

pub fn ones_on_device(shape: &[usize], device: Device) -> Self

Creates a tensor filled with ones on specified device 指定デバイス上で1で満たされたテンソルを作成

Source

pub fn try_ones(shape: &[usize]) -> RusTorchResult<Self>

Creates a tensor filled with ones with error handling. エラーハンドリング付きで1で満たされたテンソルを作成します。

Source

pub fn zeros_auto(shape: &[usize]) -> Self

Creates a tensor filled with zeros with automatic device selection 自動デバイス選択付きでゼロで満たされたテンソルを作成

Source

pub fn ones_auto(shape: &[usize]) -> Self

Creates a tensor filled with ones with automatic device selection 自動デバイス選択付きで1で満たされたテンソルを作成

Source

pub fn from_vec_auto(data: Vec<T>, shape: Vec<usize>) -> Self

Creates a tensor from vector with automatic device selection 自動デバイス選択付きでベクトルからテンソルを作成

Source

pub fn from_scalar(value: T) -> Self

Create a scalar tensor from a single value 単一の値からスカラーテンソルを作成

Source

pub fn from_ndarray(array: ArrayD<T>) -> Self

Create tensor from ndarray ndarrayからテンソルを作成

Source

pub fn full(shape: &[usize], value: T) -> Self

Creates a tensor filled with a specific value. 指定された値で満たされたテンソルを作成します。

Source

pub fn shape(&self) -> &[usize]

Returns the shape of the tensor. テンソルの形状を返します。

Source

pub fn ndim(&self) -> usize

Returns the number of dimensions. 次元数を返します。

Source

pub fn size(&self) -> Vec<usize>

Returns the size of the tensor (total number of elements). テンソルのサイズ(要素の総数)を返します。

Source

pub fn numel(&self) -> usize

Returns the number of elements in the tensor. テンソル内の要素数を返します。

Source

pub fn is_empty(&self) -> bool

Returns true if the tensor is empty. テンソルが空の場合trueを返します。

Source

pub fn resolve_dim(&self, dim: isize) -> Result<usize, String>

Resolve a dimension index (supports negative indexing) 次元インデックスを解決(負のインデックスをサポート)

Source

pub fn reshape(&self, new_shape: &[usize]) -> RusTorchResult<Self>

Reshapes the tensor to the given shape (new v2 implementation). テンソルを指定された形状に変形します。(新v2実装)

Source

pub fn try_view(&self, shape: &[usize]) -> RusTorchResult<Self>

Creates a view into the tensor. テンソルのビューを作成します。 Creates a view into the tensor with proper error handling. 適切なエラーハンドリング付きでテンソルのビューを作成します。

Source

pub fn as_slice(&self) -> Option<&[T]>

Flattens the tensor to 1D. テンソルを1次元に平坦化します。 Returns a reference to the underlying data as a slice. 基になるデータへのスライス参照を返します。

Source

pub fn as_slice_mut(&mut self) -> Option<&mut [T]>

Returns a mutable reference to the underlying data as a slice. 基になるデータへの可変スライス参照を返します。

Source

pub fn as_array(&self) -> &ArrayD<T>

Returns a reference to the underlying ndarray. 基になるndarrayへの参照を返します。

Source

pub fn as_array_mut(&mut self) -> &mut ArrayD<T>

Returns a mutable reference to the underlying ndarray. 基になるndarrayへの可変参照を返します。

Source

pub fn get(&self, index: &[usize]) -> Option<T>

Gets an element at the specified index. 指定されたインデックスの要素を取得します。

Source

pub fn set(&mut self, index: &[usize], value: T) -> Result<(), String>

Sets an element at the specified index. 指定されたインデックスの要素を設定します。

Source

pub fn where_( &self, condition: &ArrayD<bool>, other: &Tensor<T>, ) -> RusTorchResult<Tensor<T>>

Select elements from self or other based on condition 条件に基づいてselfまたはotherから要素を選択

Source

pub fn masked_select(&self, mask: &ArrayD<bool>) -> RusTorchResult<Tensor<T>>

Select elements where mask is true マスクがtrueの位置の要素を選択

Source

pub fn masked_fill( &self, mask: &ArrayD<bool>, value: T, ) -> RusTorchResult<Tensor<T>>

Fill tensor elements where mask is true with value マスクがtrueの位置の要素を値で埋める

Source

pub fn gather( &self, dim: usize, index: &ArrayD<i64>, ) -> RusTorchResult<Tensor<T>>

Gather values along an axis 軸に沿って値を収集

Source

pub fn scatter( &self, dim: usize, index: &ArrayD<i64>, src: &Tensor<T>, ) -> RusTorchResult<Tensor<T>>

Scatter values along an axis 軸に沿って値を散布

Source

pub fn index_select( &self, dim: usize, index: &ArrayD<i64>, ) -> RusTorchResult<Tensor<T>>

Select values along an axis using index インデックスを使って軸に沿って値を選択

Source

pub fn topk_util( &self, k: usize, dim: usize, largest: bool, sorted: bool, ) -> RusTorchResult<(Tensor<T>, ArrayD<i64>)>

Get top k elements along dimension (Phase 8 utilities) 次元に沿ってトップk要素を取得(フェーズ8ユーティリティ)

Source

pub fn kthvalue( &self, k: usize, dim: usize, keepdim: bool, ) -> RusTorchResult<(Tensor<T>, ArrayD<i64>)>

Get kth smallest/largest value k番目の最小/最大値を取得

Source

pub fn unique( &self, sorted: bool, return_inverse: bool, return_counts: bool, ) -> RusTorchResult<(Tensor<T>, Option<ArrayD<i64>>, Option<ArrayD<i64>>)>

Get unique elements 一意の要素を取得

Source

pub fn histogram( &self, bins: usize, range: Option<(T, T)>, ) -> RusTorchResult<(ArrayD<i64>, Tensor<T>)>

Compute histogram ヒストグラムを計算

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn sqrt(&self) -> Self

Element-wise square root 要素ごとの平方根

Source§

impl<T: Float + 'static> Tensor<T>

Source

pub fn save<P: AsRef<Path>>(&self, path: P) -> SerializationResult<()>

Save tensor to file テンソルをファイルに保存

Source

pub fn load<P: AsRef<Path>>(path: P) -> SerializationResult<Self>

Load tensor from file
ファイルからテンソルを読み込み

Source

pub fn clone_to_device(&self, device: Device) -> Self

Clone tensor with new device 新しいデバイスでテンソルをクローン

Source

pub fn clone_with_grad(&self, requires_grad: bool) -> Self

Clone tensor with new gradient requirement 新しい勾配要件でテンソルをクローン

Source

pub fn get_metadata(&self) -> HashMap<String, String>

Get tensor metadata for serialization シリアライゼーション用テンソルメタデータを取得

Source§

impl<T: Float + Clone + 'static> Tensor<T>

Enhanced tensor operations with memory pool integration メモリプール統合による拡張テンソル演算

Source

pub fn with_pool(shape: &[usize]) -> Self

Create tensor with optimized memory allocation 最適化されたメモリ割り当てでテンソルを作成

Source

pub fn matmul_pooled(&self, other: &Tensor<T>) -> Tensor<T>

Efficient matrix multiplication using memory pool メモリプールを使用した効率的な行列乗算

Source

pub fn batch_add(&self, tensors: &[&Tensor<T>]) -> Vec<Tensor<T>>

Batch operations with memory pool optimization メモリプール最適化によるバッチ演算

Source

pub fn apply_pooled<F>(&self, f: F) -> Tensor<T>
where F: Fn(T) -> T,

Memory-efficient element-wise operations メモリ効率的な要素ごと演算

Source

pub fn sum_pooled(&self) -> T

Optimized reduction operations 最適化されたリダクション演算

Source

pub fn pool_stats() -> String

Memory pool statistics for debugging デバッグ用メモリプール統計

Source

pub fn clear_pools()

Clear memory pools (useful for testing) メモリプールをクリア(テスト用)

Source§

impl Tensor<f32>

Specialized implementations for common types 一般的な型の特殊化実装

Source

pub fn fast_conv2d(&self, kernel: &Tensor<f32>) -> Tensor<f32>

F32-specific optimized operations F32特化最適化演算

Source§

impl Tensor<f64>

Source

pub fn high_precision_matmul(&self, other: &Tensor<f64>) -> Tensor<f64>

F64-specific high-precision operations F64特化高精度演算

Source§

impl<T: Float + 'static> Tensor<Complex<T>>

Complex matrix operations

Source

pub fn matmul(&self, other: &Self) -> Result<Self, String>

Complex matrix multiplication 複素行列の乗算

Source

pub fn transpose(&self) -> Result<Self, String>

Complex matrix transpose 複素行列の転置

Source

pub fn conj_transpose(&self) -> Result<Self, String>

Complex matrix conjugate transpose (Hermitian transpose) 複素行列の共役転置(エルミート転置)

Source

pub fn trace(&self) -> Result<Complex<T>, String>

Complex matrix trace (sum of diagonal elements) 複素行列のトレース(対角要素の和)

Source

pub fn determinant(&self) -> Result<Complex<T>, String>

Complex matrix determinant (2x2 only for now) 複素行列の行列式(現在は2x2のみ)

Source

pub fn fft( &self, n: Option<usize>, _dim: Option<isize>, norm: Option<&str>, ) -> Result<Self, String>
where T: Float + 'static + Default + Clone + Debug + FromPrimitive,

Forward FFT for complex tensor 複素テンソルの順フーリエ変換

Source

pub fn ifft( &self, n: Option<usize>, _dim: Option<isize>, norm: Option<&str>, ) -> Result<Self, String>
where T: Float + 'static + Default + Clone + Debug + FromPrimitive,

Inverse FFT for complex tensor 複素テンソルの逆フーリエ変換

Source

pub fn fftshift(&self, _dim: Option<&[isize]>) -> Result<Self, String>

FFT shift for complex tensor 複素テンソルのFFTシフト

Source

pub fn ifftshift(&self, _dim: Option<&[isize]>) -> Result<Self, String>

Inverse FFT shift for complex tensor 複素テンソルの逆FFTシフト

Source§

impl<T: Float + 'static> Tensor<Complex<T>>

Complex tensor factory functions

Source

pub fn complex_zeros(shape: &[usize]) -> Self

Create a complex tensor with all zeros すべてゼロの複素テンソルを作成

Source

pub fn complex_ones(shape: &[usize]) -> Self

Create a complex tensor with all ones すべて1の複素テンソルを作成

Source

pub fn complex_i(shape: &[usize]) -> Self

Create complex tensor filled with imaginary unit 虚数単位で満たされた複素テンソルを作成

Source

pub fn from_polar( magnitude: &Tensor<T>, phase: &Tensor<T>, ) -> Result<Self, String>

Create complex tensor from polar coordinates 極座標から複素テンソルを作成

Source

pub fn from_real(real: &Tensor<T>) -> Self

Create complex tensor from real tensor (imaginary part = 0) 実テンソルから複素テンソルを作成(虚部は0)

Source

pub fn from_imag(imag: &Tensor<T>) -> Self

Create complex tensor from imaginary tensor (real part = 0) 虚テンソルから複素テンソルを作成(実部は0)

Source§

impl<T: Float + 'static> Tensor<Complex<T>>

Complex mathematical operations for tensors

Source

pub fn exp(&self) -> Self

Element-wise exponential e^z for complex tensor 複素テンソルの要素ごとの指数関数 e^z

Source

pub fn ln(&self) -> Self

Element-wise natural logarithm ln(z) for complex tensor 複素テンソルの要素ごとの自然対数 ln(z)

Source

pub fn pow(&self, exponent: &Self) -> Result<Self, String>

Element-wise power z^w for complex tensor 複素テンソルの要素ごとのべき乗 z^w

Source

pub fn pow_scalar(&self, exponent: Complex<T>) -> Self

Element-wise power with scalar exponent z^s スカラー指数でのべき乗 z^s

Source

pub fn sqrt(&self) -> Self

Element-wise square root √z for complex tensor 複素テンソルの要素ごとの平方根 √z

Source

pub fn sin(&self) -> Self

Element-wise sine sin(z) for complex tensor 複素テンソルの要素ごとの正弦 sin(z)

Source

pub fn cos(&self) -> Self

Element-wise cosine cos(z) for complex tensor 複素テンソルの要素ごとの余弦 cos(z)

Source

pub fn tan(&self) -> Self

Element-wise tangent tan(z) for complex tensor 複素テンソルの要素ごとの正接 tan(z)

Source

pub fn sinh(&self) -> Self

Element-wise hyperbolic sine sinh(z) for complex tensor 複素テンソルの要素ごとの双曲正弦 sinh(z)

Source

pub fn cosh(&self) -> Self

Element-wise hyperbolic cosine cosh(z) for complex tensor 複素テンソルの要素ごとの双曲余弦 cosh(z)

Source

pub fn tanh(&self) -> Self

Element-wise hyperbolic tangent tanh(z) for complex tensor 複素テンソルの要素ごとの双曲正接 tanh(z)

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn add(&self, other: &Tensor<T>) -> RusTorchResult<Self>
where T: ScalarOperand + Copy,

Element-wise addition with another tensor 他のテンソルとの要素ごとの加算

Source

pub fn sub(&self, other: &Tensor<T>) -> RusTorchResult<Self>
where T: ScalarOperand + Copy,

Element-wise subtraction with another tensor 他のテンソルとの要素ごとの減算

Source

pub fn mul(&self, other: &Tensor<T>) -> RusTorchResult<Self>
where T: ScalarOperand + Copy,

Element-wise multiplication with another tensor 他のテンソルとの要素ごとの乗算

Source

pub fn div(&self, other: &Tensor<T>) -> RusTorchResult<Self>
where T: ScalarOperand + Copy,

Element-wise division with another tensor 他のテンソルとの要素ごとの除算

Source

pub fn add_scalar(&self, scalar: T) -> Self

Add scalar to all elements (new implementation) 全要素にスカラーを加算(新実装)

Source

pub fn sub_scalar(&self, scalar: T) -> Self

Subtract scalar from all elements (new implementation) 全要素からスカラーを減算(新実装)

Source

pub fn mul_scalar(&self, scalar: T) -> Self

Multiply all elements by scalar (new implementation) 全要素をスカラーで乗算(新実装)

Source

pub fn div_scalar(&self, scalar: T) -> Self

Divide all elements by scalar (new implementation) 全要素をスカラーで除算(新実装)

Source

pub fn neg(&self) -> Self

Negate all elements (new implementation) 全要素の符号を反転(新実装)

Source

pub fn maximum(&self, other: &Tensor<T>) -> RusTorchResult<Self>
where T: ScalarOperand + Copy,

Element-wise maximum with another tensor (new implementation) 他のテンソルとの要素ごとの最大値(新実装)

Source

pub fn minimum(&self, other: &Tensor<T>) -> RusTorchResult<Self>
where T: ScalarOperand + Copy,

Element-wise minimum with another tensor (new implementation) 他のテンソルとの要素ごとの最小値(新実装)

Source

pub fn sum(&self) -> T

Sum all elements in the tensor テンソル内のすべての要素の和

Source

pub fn mean(&self) -> T

Mean of all elements in the tensor テンソル内のすべての要素の平均

Source

pub fn sum_axis(&self, axis: usize) -> RusTorchResult<Tensor<T>>

Sum along a specific axis 特定の軸に沿って和を計算

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn exp(&self) -> Self

Apply exponential function element-wise 要素ごとに指数関数を適用

Source

pub fn ln(&self) -> Self

Apply natural logarithm element-wise 要素ごとに自然対数を適用

Source

pub fn sin(&self) -> Self

Apply sine function element-wise 要素ごとにサイン関数を適用

Source

pub fn cos(&self) -> Self

Apply cosine function element-wise 要素ごとにコサイン関数を適用

Source

pub fn tan(&self) -> Self

Apply tangent function element-wise 要素ごとにタンジェント関数を適用

Source

pub fn abs(&self) -> Self

Apply absolute value element-wise 要素ごとに絶対値を適用

Source

pub fn pow(&self, exponent: T) -> Self

Power operation element-wise 要素ごとのべき乗演算

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn matmul(&self, other: &Tensor<T>) -> RusTorchResult<Self>

Matrix multiplication 行列乗算

Source

pub fn transpose_last_two(&self) -> RusTorchResult<Self>

Transpose the last two dimensions 最後の2次元を転置

Source

pub fn transpose(&self) -> RusTorchResult<Self>

Simple 2D transpose (new implementation) 単純な2D転置(新実装)

Source

pub fn det(&self) -> RusTorchResult<T>

Compute determinant (for 2D square matrices only) 行列式の計算(2D正方行列のみ)

Source

pub fn trace(&self) -> RusTorchResult<T>

Trace (sum of diagonal elements) トレース(対角要素の和)

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn matmul_metal( &self, other: &Tensor<T>, _device_id: usize, ) -> RusTorchResult<Self>

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive + Default + Clone + Debug> Tensor<T>

Source

pub fn fft( &self, n: Option<usize>, dim: Option<isize>, norm: Option<&str>, ) -> Result<(Self, Self), String>

Fast Fourier Transform (basic implementation) 高速フーリエ変換(基本実装)

Source

pub fn ifft( &self, real_part: &Self, imag_part: &Self, n: Option<usize>, dim: Option<isize>, norm: Option<&str>, ) -> Result<(Self, Self), String>

Inverse Fast Fourier Transform (basic implementation) 逆高速フーリエ変換(基本実装)

Source

pub fn rfft( &self, n: Option<usize>, dim: Option<isize>, norm: Option<&str>, ) -> Result<(Self, Self), String>

Real Fast Fourier Transform (basic implementation) 実数高速フーリエ変換(基本実装)

Source

pub fn fftshift(&self, dim: Option<&[isize]>) -> Result<Self, String>

Shift zero-frequency component to center of spectrum ゼロ周波数成分をスペクトラムの中央にシフト

Source

pub fn ifftshift(&self, dim: Option<&[isize]>) -> Result<Self, String>

Inverse of fftshift fftshiftの逆

Source

pub fn apply_window( &self, window_type: WindowType, axis: Option<usize>, ) -> Result<Self, String>

Apply window function to the tensor テンソルに窓関数を適用

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn item(&self) -> T

Get a single scalar value (for 0-dim or 1-element tensors) スカラー値を取得(0次元または1要素テンソル用)

Source

pub fn mean_axis(&self, axis: usize) -> RusTorchResult<Self>

Mean along a specific axis (new implementation) 特定の軸に沿った平均(新実装)

Source

pub fn var(&self) -> T

Variance of all elements 全要素の分散

Source

pub fn std(&self) -> T

Standard deviation of all elements 全要素の標準偏差

Source

pub fn min(&self) -> T

Minimum value 最小値

Source

pub fn max(&self) -> T

Maximum value 最大値

Source

pub fn argmin(&self) -> usize

Argmin - index of minimum value (flattened) 最小値のインデックス(平坦化)

Source

pub fn argmax(&self) -> usize

Argmax - index of maximum value (flattened) 最大値のインデックス(平坦化)

Source

pub fn median(&self) -> T

Median value (approximate for efficiency) 中央値(効率性のため近似)

Source

pub fn quantile(&self, q: f64) -> T

Quantile (0.0 to 1.0) 分位数(0.0から1.0)

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn batch_size(&self) -> usize

Get the batch size (first dimension) バッチサイズを取得(最初の次元)

Source

pub fn map<F>(&self, f: F) -> Tensor<T>
where F: Fn(T) -> T,

Apply function to each element 各要素に関数を適用

Source

pub fn map_inplace<F>(&mut self, f: F)
where F: Fn(T) -> T,

Apply function to each element in-place 各要素に関数をin-placeで適用

Source

pub fn stack(tensors: &[&Tensor<T>]) -> RusTorchResult<Tensor<T>>

Stack tensors along a new axis (new implementation) 新しい軸に沿ってテンソルを積み重ね(新実装)

Source

pub fn concatenate( tensors: &[&Tensor<T>], axis: usize, ) -> RusTorchResult<Tensor<T>>

Concatenate tensors along an existing axis (new implementation) 既存の軸に沿ってテンソルを連結(新実装)

Source

pub fn clone_tensor(&self) -> Self

Clone tensor data (explicit for clarity) テンソルデータのクローン(明示的)

Source

pub fn randn(shape: &[usize]) -> Tensor<T>

Create a tensor with random values from standard normal distribution 標準正規分布からランダムな値を持つテンソルを作成

Source

pub fn rand(shape: &[usize]) -> Tensor<T>

Create a tensor with random values from uniform distribution [0, 1) 一様分布[0, 1)からランダムな値を持つテンソルを作成

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive + Clone + Debug> Tensor<T>

Source

pub fn norm(&self) -> T

Calculate L2 (Euclidean) norm L2(ユークリッド)ノルムを計算

Source

pub fn norm_p(&self, p: T) -> T

Calculate Lp norm with specified p 指定されたpでLpノルムを計算

Source

pub fn frobenius_norm(&self) -> T

Calculate Frobenius norm for matrices 行列用フロベニウスノルムを計算

Source

pub fn nuclear_norm(&self) -> RusTorchResult<T>

Calculate nuclear norm (sum of singular values) 核ノルム(特異値の和)を計算

Source

pub fn svd(&self) -> RusTorchResult<(Tensor<T>, Tensor<T>, Tensor<T>)>

Singular Value Decomposition (SVD) 特異値分解

Source

pub fn eigh(&self) -> RusTorchResult<(Tensor<T>, Tensor<T>)>

Eigenvalue decomposition for symmetric matrices 対称行列用固有値分解

Source

pub fn qr(&self) -> RusTorchResult<(Tensor<T>, Tensor<T>)>

QR decomposition QR分解

Source

pub fn cholesky(&self) -> RusTorchResult<Tensor<T>>

Cholesky decomposition for positive definite matrices 正定値行列用コレスキー分解

Source

pub fn inverse(&self) -> RusTorchResult<Tensor<T>>

Compute matrix inverse using LU decomposition LU分解を使用した逆行列の計算

Source

pub fn pinv(&self) -> RusTorchResult<Tensor<T>>

Compute Moore-Penrose pseudo-inverse Moore-Penrose疑似逆行列の計算

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn sinh(&self) -> Self

Apply hyperbolic sine element-wise 要素ごとに双曲線サインを適用

Source

pub fn cosh(&self) -> Self

Apply hyperbolic cosine element-wise 要素ごとに双曲線コサインを適用

Source

pub fn tanh(&self) -> Self

Apply hyperbolic tangent element-wise 要素ごとに双曲線タンジェントを適用

Source

pub fn asinh(&self) -> Self

Apply inverse hyperbolic sine element-wise 要素ごとに逆双曲線サインを適用

Source

pub fn acosh(&self) -> Self

Apply inverse hyperbolic cosine element-wise 要素ごとに逆双曲線コサインを適用

Source

pub fn atanh(&self) -> Self

Apply inverse hyperbolic tangent element-wise 要素ごとに逆双曲線タンジェントを適用

Source

pub fn asin(&self) -> Self

Apply arcsine element-wise 要素ごとにアークサインを適用

Source

pub fn acos(&self) -> Self

Apply arccosine element-wise 要素ごとにアークコサインを適用

Source

pub fn atan(&self) -> Self

Apply arctangent element-wise 要素ごとにアークタンジェントを適用

Source

pub fn atan2(&self, other: &Tensor<T>) -> RusTorchResult<Self>

Apply two-argument arctangent element-wise 要素ごとに二引数アークタンジェントを適用

Source

pub fn floor(&self) -> Self

Apply floor function element-wise 要素ごとにフロア関数を適用

Source

pub fn ceil(&self) -> Self

Apply ceiling function element-wise 要素ごとにシーリング関数を適用

Source

pub fn round(&self) -> Self

Apply round function element-wise 要素ごとにラウンド関数を適用

Source

pub fn trunc(&self) -> Self

Apply truncation function element-wise 要素ごとに切り捨て関数を適用

Source

pub fn pow_tensor(&self, exponent: &Tensor<T>) -> RusTorchResult<Self>

Raise elements to powers from another tensor 他のテンソルの要素をべき指数として使用

Source

pub fn square(&self) -> Self

Apply square element-wise 要素ごとに平方を適用

Source

pub fn log10(&self) -> Self

Apply logarithm base 10 element-wise 要素ごとに常用対数を適用

Source

pub fn log2(&self) -> Self

Apply logarithm base 2 element-wise 要素ごとに二進対数を適用

Source

pub fn log(&self, base: T) -> Self

Apply logarithm with custom base element-wise 要素ごとにカスタム底の対数を適用

Source

pub fn clamp(&self, min_val: T, max_val: T) -> Self

Clamp values between min and max 値をminとmaxの間にクランプ

Source

pub fn sign(&self) -> Self

Sign function: returns -1, 0, or 1 符号関数: -1, 0, 1を返す

Source

pub fn lerp(&self, other: &Tensor<T>, weight: T) -> RusTorchResult<Self>

Linear interpolation between two tensors 2つのテンソル間の線形補間

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive + PartialOrd + Clone> Tensor<T>

Source

pub fn var_unbiased(&self) -> T

Calculate unbiased variance along all dimensions 全次元での不偏分散を計算

Source

pub fn var_axis(&self, axis: usize) -> RusTorchResult<Tensor<T>>

Calculate variance along a specific axis 特定軸での分散を計算

Source

pub fn std_unbiased(&self) -> T

Calculate unbiased standard deviation along all dimensions 全次元での不偏標準偏差を計算

Source

pub fn std_axis(&self, axis: usize) -> RusTorchResult<Tensor<T>>

Calculate standard deviation along a specific axis 特定軸での標準偏差を計算

Source

pub fn quantile_advanced(&self, q: f64) -> RusTorchResult<T>

Calculate quantile value (q between 0 and 1) - advanced version 分位数値を計算 (qは0から1の間) - 高度版

Source

pub fn percentile(&self, p: f64) -> RusTorchResult<T>

Calculate percentile value (p between 0 and 100) パーセンタイル値を計算 (pは0から100の間)

Source

pub fn cumsum(&self, axis: usize) -> RusTorchResult<Tensor<T>>

Calculate cumulative sum along a specific axis (simplified implementation) 特定軸での累積和を計算(簡単化実装)

Source

pub fn cumprod(&self, axis: usize) -> RusTorchResult<Tensor<T>>

Calculate cumulative product along a specific axis (simplified implementation) 特定軸での累積積を計算(簡单化実装)

Source

pub fn argmin_axis(&self, axis: usize) -> RusTorchResult<Vec<usize>>

Find indices of minimum values along an axis 軸に沿った最小値のインデックスを検索

Source

pub fn argmax_axis(&self, axis: usize) -> RusTorchResult<Vec<usize>>

Find indices of maximum values along an axis 軸に沿った最大値のインデックスを検索

Source

pub fn topk(&self, k: usize) -> RusTorchResult<(Tensor<T>, Vec<usize>)>

Find top-k largest values and their indices 上位k個の最大値とそのインデックスを検索

Source

pub fn bottomk(&self, k: usize) -> RusTorchResult<(Tensor<T>, Vec<usize>)>

Find bottom-k smallest values and their indices 下位k個の最小値とそのインデックスを検索

Source

pub fn corrcoef(&self, other: &Tensor<T>) -> RusTorchResult<T>

Calculate correlation coefficient between two 1D tensors 2つの1次元テンソル間の相関係数を計算

Source

pub fn cov(&self, other: &Tensor<T>) -> RusTorchResult<T>

Calculate covariance between two 1D tensors 2つの1次元テンソル間の共分散を計算

Source§

impl<T: Float + Clone + 'static> Tensor<T>

Source

pub fn squeeze(&self) -> Self

Remove singleton dimensions (size 1) from tensor テンソルから単一次元(サイズ1)を削除

§Ownership Patterns / 所有権パターン
  • squeeze() - Always creates new tensor (owned)
  • squeeze_view() - Attempts zero-copy view, fallback to owned
  • squeeze_inplace() - Modifies existing tensor (requires &mut)
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0], vec![1, 3, 1]);

// Always safe - creates new tensor
let squeezed = tensor.squeeze();
assert_eq!(squeezed.shape(), &[3]);

// Zero-copy when possible
let squeezed_view = tensor.squeeze_view().unwrap();

// In-place modification
let mut tensor_mut = tensor.clone();
tensor_mut.squeeze_inplace().unwrap();
Source

pub fn squeeze_view(&self) -> RusTorchResult<Self>

Remove singleton dimensions with zero-copy optimization ゼロコピー最適化で単一次元を削除

Source

pub fn squeeze_inplace(&mut self) -> RusTorchResult<()>

Remove singleton dimensions in-place (requires mutable reference) 単一次元をインプレースで削除(可変参照が必要)

Source

pub fn squeeze_dim(&self, dim: usize) -> RusTorchResult<Self>

Remove singleton dimensions from specific dimension 特定の次元から単一次元を削除

Source

pub fn unsqueeze(&self, dim: usize) -> RusTorchResult<Self>

Add singleton dimension at specified position 指定位置に単一次元を追加

§Ownership Patterns / 所有権パターン
  • unsqueeze() - Always creates new tensor (owned)
  • unsqueeze_view() - Attempts zero-copy view
  • unsqueeze_inplace() - Modifies existing tensor
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0], vec![3]);

// Add dimension at start
let unsqueezed = tensor.unsqueeze(0).unwrap();
assert_eq!(unsqueezed.shape(), &[1, 3]);

// Add dimension at end  
let unsqueezed = tensor.unsqueeze(1).unwrap();
assert_eq!(unsqueezed.shape(), &[3, 1]);
Source

pub fn unsqueeze_view(&self, dim: usize) -> RusTorchResult<Self>

Add singleton dimension with zero-copy optimization ゼロコピー最適化で単一次元を追加

Source

pub fn unsqueeze_inplace(&mut self, dim: usize) -> RusTorchResult<()>

Add singleton dimension in-place 単一次元をインプレースで追加

Source

pub fn expand_owned(&self, target_shape: &[usize]) -> RusTorchResult<Self>

Expand tensor dimensions through broadcasting (ownership-aware version) ブロードキャストによってテンソル次元を拡張(所有権対応版)

§Ownership Considerations / 所有権の考慮事項

Expand operations typically require data duplication, so we provide:

  • expand_owned() - Creates new tensor with explicit memory allocation
  • expand_lazy() - Returns lazy view that computes on access (memory efficient)
  • expand_shared() - Uses shared ownership with Arc for memory efficiency
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0], vec![1, 3]);

// Expand to larger shape
let expanded = tensor.expand_owned(&[4, 3]).unwrap();
assert_eq!(expanded.shape(), &[4, 3]);

// Memory-efficient lazy expansion
let lazy_expanded = tensor.expand_lazy(&[4, 3]).unwrap();
Source

pub fn expand_shared(&self, target_shape: &[usize]) -> RusTorchResult<Arc<Self>>

Expand with shared ownership for memory efficiency メモリ効率のための共有所有権で拡張

Source

pub fn expand_lazy( &self, target_shape: &[usize], ) -> RusTorchResult<LazyExpandedTensor<T>>

Lazy expand that defers computation until access アクセス時まで計算を遅延する遅延拡張

Source

pub fn flatten_owned(&self) -> Self

Flatten tensor dimensions into 1D (ownership-aware version) テンソル次元を1Dに平坦化(所有権対応版)

§Ownership Patterns / 所有権パターン
  • flatten_owned() - Always creates new 1D tensor
  • flatten_range() - Flatten specific dimension range
  • flatten_inplace() - In-place flattening when possible
  • flatten_view() - Zero-copy view when layout allows
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0, 4.0], vec![2, 2]);

// Full flatten
let flattened = tensor.flatten_owned();
assert_eq!(flattened.shape(), &[4]);

// Flatten from specific dimension
let partial_flatten = tensor.flatten_range(1, None).unwrap();
assert_eq!(partial_flatten.shape(), &[2, 2]);
Source

pub fn flatten_range( &self, start_dim: usize, end_dim: Option<usize>, ) -> RusTorchResult<Self>

Flatten specific dimension range 特定の次元範囲を平坦化

Source

pub fn flatten_inplace(&mut self) -> RusTorchResult<()>

Flatten in-place when layout allows レイアウトが許可する場合のインプレース平坦化

Source

pub fn flatten_view(&self) -> RusTorchResult<Self>

Zero-copy flatten when memory layout allows メモリレイアウトが許可する場合のゼロコピー平坦化

Source

pub fn is_contiguous(&self) -> bool

Check if tensor data is contiguous in memory テンソルデータがメモリ内で連続しているかチェック

Source

pub fn can_broadcast_with(&self, other: &Self) -> bool

Check if this tensor can broadcast with another tensor このテンソルが別のテンソルとブロードキャスト可能かチェック

Source

pub fn broadcast_with(&self, other: &Self) -> RusTorchResult<(Self, Self)>

Broadcast two tensors to compatible shapes 2つのテンソルを互換形状にブロードキャスト

Source

pub fn expand_dims(&self, axis: usize) -> RusTorchResult<Self>

Add singleton dimension (alias for unsqueeze for compatibility) 単一次元追加(互換性のためのunsqueezeエイリアス)

Source

pub fn expand_as(&self, other: &Self) -> RusTorchResult<Self>

Expand tensor to match the shape of another tensor (PyTorch expand_as compatibility) 他のテンソルの形状に合わせて拡張(PyTorch expand_as互換)

§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0], vec![1, 2]);
let target = Tensor::from_vec(vec![0.0; 6], vec![3, 2]);
let expanded = tensor.expand_as(&target).unwrap();
assert_eq!(expanded.shape(), target.shape());
Source

pub fn unflatten(&self, dim: usize, sizes: &[usize]) -> RusTorchResult<Self>

Unflatten a tensor dimension into multiple dimensions テンソルの次元を複数の次元に復元

§Arguments
  • dim - Dimension to unflatten
  • sizes - Target sizes for new dimensions
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0, 4.0, 5.0, 6.0], vec![6]);
let unflattened = tensor.unflatten(0, &[2, 3]).unwrap();
assert_eq!(unflattened.shape(), &[2, 3]);
Source

pub fn repeat(&self, repeats: &[usize]) -> RusTorchResult<Self>

Repeat tensor along specified dimensions (PyTorch repeat compatibility) 指定された次元に沿ってテンソルを繰り返し(PyTorch repeat互換)

§Arguments
  • repeats - Number of repetitions for each dimension
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0], vec![2]);
let repeated = tensor.repeat(&[3, 2]).unwrap();
assert_eq!(repeated.shape(), &[3, 4]); // [3, 2*2]
Source

pub fn repeat_interleave_scalar( &self, repeats: usize, dim: Option<usize>, ) -> RusTorchResult<Self>

Repeat elements of tensor along specified dimension 指定次元に沿ってテンソルの要素を繰り返し

§Arguments
  • repeats - Number of repetitions for each element (scalar or tensor)
  • dim - Dimension along which to repeat (optional)
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0], vec![3]);
let repeated = tensor.repeat_interleave_scalar(2, Some(0)).unwrap();
assert_eq!(repeated.shape(), &[6]); // Each element repeated twice
Source

pub fn roll_1d(&self, shifts: isize, dim: Option<usize>) -> RusTorchResult<Self>

Roll tensor along specified dimensions 指定された次元に沿ってテンソルをロール

§Arguments
  • shifts - Number of places to shift
  • dims - Dimensions to roll along (optional)
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0, 4.0], vec![4]);
let rolled = tensor.roll_1d(1, Some(0)).unwrap();
// Result: [4.0, 1.0, 2.0, 3.0]
Source

pub fn rot90(&self, k: isize, dims: &[usize]) -> RusTorchResult<Self>

Rotate tensor 90 degrees in the plane specified by dims 指定された次元平面でテンソルを90度回転

§Arguments
  • k - Number of 90-degree rotations
  • dims - Two dimensions defining the rotation plane
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0, 4.0], vec![2, 2]);
let rotated = tensor.rot90(1, &[0, 1]).unwrap();
// 90-degree rotation
Source

pub fn flip(&self, dims: &[usize]) -> RusTorchResult<Self>

Flip tensor along specified dimensions 指定された次元に沿ってテンソルを反転

§Arguments
  • dims - Dimensions to flip
§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0, 4.0], vec![2, 2]);
let flipped = tensor.flip(&[0]).unwrap();
// Flip along dimension 0
Source

pub fn fliplr(&self) -> RusTorchResult<Self>

Flip tensor left-right (along last dimension) テンソルを左右反転(最後の次元に沿って)

§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0, 4.0], vec![2, 2]);
let flipped = tensor.fliplr().unwrap();
Source

pub fn flipud(&self) -> RusTorchResult<Self>

Flip tensor up-down (along first dimension)
テンソルを上下反転(最初の次元に沿って)

§Examples
use rustorch::prelude::Tensor;
let tensor = Tensor::from_vec(vec![1.0, 2.0, 3.0, 4.0], vec![2, 2]);
let flipped = tensor.flipud().unwrap();
Source§

impl<T: Float + Clone + 'static> Tensor<T>

Convenient methods for common shape operation patterns 一般的な形状操作パターンの便利なメソッド

Source

pub fn view_shape(&self, shape: &[usize]) -> RusTorchResult<Self>

PyTorch-like view method for reshaping with ownership semantics 所有権セマンティクスでのPyTorchライクなviewメソッド

Source

pub fn shape_builder(self) -> ShapeBuilder<T>

Create shape builder for chaining operations 操作チェーン用の形状ビルダーを作成

Source§

impl<T: Float + Send + Sync + Clone + 'static> Tensor<T>

Parallel batch operations for tensors テンソルの並列バッチ演算

Source

pub fn batch_matmul_parallel( &self, other: &Tensor<T>, ) -> RusTorchResult<Tensor<T>>

Parallel batch matrix multiplication 並列バッチ行列乗算

Source

pub fn batch_add_parallel(&self, other: &Tensor<T>) -> RusTorchResult<Tensor<T>>

Parallel batch element-wise operations 並列バッチ要素ごと演算

Source

pub fn batch_mul_scalar_parallel(&self, scalar: T) -> Tensor<T>

Parallel batch scalar multiplication 並列バッチスカラー乗算

Source

pub fn batch_normalize_parallel(&self, epsilon: T) -> Tensor<T>

Parallel batch normalization 並列バッチ正規化

Source

pub fn batch_conv2d_parallel( &self, kernel: &Tensor<T>, stride: usize, padding: usize, ) -> RusTorchResult<Tensor<T>>

Parallel batch convolution (simplified 2D) 並列バッチ畳み込み(簡略化2D)

Source

pub fn batch_sum_parallel(&self, dim: usize) -> RusTorchResult<Tensor<T>>

Parallel batch reduction operations 並列バッチリダクション演算

Source

pub fn batch_mean_parallel(&self, dim: usize) -> RusTorchResult<Tensor<T>>

Parallel batch mean computation 並列バッチ平均計算

Source§

impl Tensor<f32>

Specialized f32 implementations with SIMD integration SIMD統合を含むf32特殊化実装

Source

pub fn batch_simd_add_parallel( &self, other: &Tensor<f32>, ) -> RusTorchResult<Tensor<f32>>

High-performance parallel batch operations for f32 f32用高性能並列バッチ演算

Source

pub fn batch_simd_matmul_parallel( &self, other: &Tensor<f32>, ) -> RusTorchResult<Tensor<f32>>

Parallel batch matrix multiplication with SIMD optimization SIMD最適化を含む並列バッチ行列乗算

Source§

impl<T: Float + Send + Sync + Clone + 'static + ScalarOperand + FromPrimitive> Tensor<T>

Source

pub fn gpu_sum(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU sum operation

Source

pub fn gpu_mean(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>
where T: FromPrimitive,

GPU mean operation

Source

pub fn gpu_max(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU max operation

Source

pub fn gpu_min(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU min operation

Source

pub fn gpu_std(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU standard deviation operation

Source

pub fn gpu_var(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU variance operation

Source

pub fn gpu_batch_matmul(&self, other: &Tensor<T>) -> RusTorchResult<Tensor<T>>

GPU batch matrix multiplication

Source§

impl<T: Float + Clone + 'static> Tensor<T>

Extensions for regular Tensor to work with SIMD-aligned tensors 通常のTensorがSIMDアライメントテンソルと連携するための拡張

Source

pub fn to_simd_aligned(&self) -> RusTorchResult<SimdTensor<T>>

Convert to SIMD-aligned tensor (f32 only) SIMDアライメントテンソルに変換(f32のみ)

Source

pub fn zeros_simd_aligned(shape: &[usize]) -> Self
where T: 'static,

Create tensor with SIMD-aligned allocation strategy SIMDアライメント割り当て戦略でテンソルを作成

Source§

impl<T: Float + Clone + 'static> Tensor<T>

SIMD integration utilities for tensor operations テンソル演算のSIMD統合ユーティリティ

Source

pub fn check_simd_suitability(&self) -> bool

Check if tensor is suitable for SIMD optimization テンソルがSIMD最適化に適しているかチェック

Trait Implementations§

Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Add<T> for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the + operator.
Source§

fn add(self, scalar: T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Add<T> for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the + operator.
Source§

fn add(self, scalar: T) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Add for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Add for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the + operator.
Source§

fn add(self, other: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl Avx512TensorOps<f32> for Tensor<f32>

Source§

fn avx512_add(&self, other: &Self) -> RusTorchResult<Self>

Element-wise addition using AVX-512 optimizations AVX-512最適化を使った要素ごとの加算
Source§

fn avx512_mul(&self, other: &Self) -> RusTorchResult<Self>

Element-wise multiplication using AVX-512 optimizations
AVX-512最適化を使った要素ごとの乗算
Source§

fn avx512_dot(&self, other: &Self) -> RusTorchResult<f32>

Dot product using AVX-512 optimizations AVX-512最適化を使ったドット積
Source§

impl Avx512TensorOps<f64> for Tensor<f64>

Source§

fn avx512_add(&self, other: &Self) -> RusTorchResult<Self>

Element-wise addition using AVX-512 optimizations AVX-512最適化を使った要素ごとの加算
Source§

fn avx512_mul(&self, other: &Self) -> RusTorchResult<Self>

Element-wise multiplication using AVX-512 optimizations
AVX-512最適化を使った要素ごとの乗算
Source§

fn avx512_dot(&self, other: &Self) -> RusTorchResult<f64>

Dot product using AVX-512 optimizations AVX-512最適化を使ったドット積
Source§

impl<T: Float + Send + Sync + Clone + 'static> BatchParallelOp<T> for Tensor<T>

Source§

fn batch_elementwise_op<F>( &self, other: &Tensor<T>, op: F, ) -> RusTorchResult<Tensor<T>>
where F: Fn(T, T) -> T + Send + Sync,

並列バッチ要素ごと演算 Parallel batch element-wise operations
Source§

fn batch_scalar_op<F>(&self, scalar: T, op: F) -> Tensor<T>
where F: Fn(T, T) -> T + Send + Sync,

並列バッチスカラー演算 Parallel batch scalar operations
Source§

fn batch_normalize(&self, epsilon: T) -> Tensor<T>

並列バッチ正規化 Parallel batch normalization
Source§

impl<T: Clone + Float> Clone for Tensor<T>

Source§

fn clone(&self) -> Tensor<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug + Float> Debug for Tensor<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Float + Display> Display for Tensor<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Div<T> for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the / operator.
Source§

fn div(self, scalar: T) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Div<T> for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the / operator.
Source§

fn div(self, scalar: T) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Div for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Div for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the / operator.
Source§

fn div(self, other: Self) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Float + 'static> From<ArrayBase<OwnedRepr<T>, Dim<[usize; 1]>>> for Tensor<T>

Source§

fn from(array: Array1<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Float + 'static> From<ArrayBase<OwnedRepr<T>, Dim<[usize; 2]>>> for Tensor<T>

Source§

fn from(array: Array2<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Float + 'static> From<ArrayBase<OwnedRepr<T>, Dim<IxDynImpl>>> for Tensor<T>

Source§

fn from(array: ArrayD<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Float + FromPrimitive + ScalarOperand + Send + Sync + 'static> GpuActivation<T> for Tensor<T>

Available on neither crate feature coreml nor crate feature coreml-hybrid nor crate feature coreml-fallback.
Source§

fn gpu_relu(&self) -> RusTorchResult<Tensor<T>>

GPU ReLU activation GPU ReLU活性化
Source§

fn gpu_sigmoid(&self) -> RusTorchResult<Tensor<T>>

GPU Sigmoid activation GPU Sigmoid活性化
Source§

fn gpu_tanh(&self) -> RusTorchResult<Tensor<T>>

GPU Tanh activation GPU Tanh活性化
Source§

fn gpu_softmax(&self, dim: isize) -> RusTorchResult<Tensor<T>>

GPU Softmax activation GPU Softmax活性化
Source§

fn gpu_gelu(&self) -> RusTorchResult<Tensor<T>>

GPU GELU activation GPU GELU活性化
Source§

fn gpu_leaky_relu(&self, negative_slope: f64) -> RusTorchResult<Tensor<T>>

GPU Leaky ReLU activation GPU Leaky ReLU活性化
Source§

fn gpu_elu(&self, alpha: f64) -> RusTorchResult<Tensor<T>>

GPU ELU activation GPU ELU活性化
Source§

fn gpu_swish(&self) -> RusTorchResult<Tensor<T>>

GPU Swish activation GPU Swish活性化
Source§

impl<T> GpuBatchParallelOp<T> for Tensor<T>
where T: Float + Send + Sync + Clone + 'static + Debug + FromPrimitive + ScalarOperand,

Available on non-crate feature cuda only.
Source§

fn gpu_batch_normalize(&self, epsilon: T) -> RusTorchResult<Tensor<T>>

GPU並列バッチ正規化 GPU parallel batch normalization
Source§

fn gpu_batch_conv2d( &self, kernel: &Tensor<T>, stride: usize, padding: usize, ) -> RusTorchResult<Tensor<T>>

GPU並列バッチ畳み込み GPU parallel batch convolution
Source§

fn gpu_batch_attention( &self, key: &Tensor<T>, value: &Tensor<T>, ) -> RusTorchResult<Tensor<T>>

GPU並列バッチアテンション GPU parallel batch attention
Source§

impl<T: Float + FromPrimitive + ScalarOperand + Send + Sync + 'static> GpuConvolution<T> for Tensor<T>

Available on neither crate feature coreml nor crate feature coreml-hybrid nor crate feature coreml-fallback.
Source§

fn gpu_conv2d( &self, kernel: &Self, params: &ConvolutionParams, ) -> RusTorchResult<Tensor<T>>

GPU-accelerated 2D convolution with automatic device selection 自動デバイス選択によるGPU加速2D畳み込み
Source§

fn gpu_conv_transpose2d( &self, kernel: &Self, params: &ConvolutionParams, ) -> RusTorchResult<Tensor<T>>

GPU-accelerated transposed convolution (deconvolution) GPU加速転置畳み込み(逆畳み込み)
Source§

fn gpu_depthwise_conv2d( &self, kernel: &Self, params: &ConvolutionParams, ) -> RusTorchResult<Tensor<T>>

GPU-accelerated depthwise separable convolution GPU加速深度分離可能畳み込み
Source§

fn gpu_grouped_conv2d( &self, kernel: &Self, params: &ConvolutionParams, groups: usize, ) -> RusTorchResult<Tensor<T>>

GPU-accelerated grouped convolution GPU加速グループ畳み込み
Source§

fn gpu_conv3d( &self, kernel: &Self, params: &ConvolutionParams, ) -> RusTorchResult<Tensor<T>>

GPU-accelerated 3D convolution GPU加速3D畳み込み
Source§

impl<T: Float + FromPrimitive + ScalarOperand + Send + Sync + 'static> GpuLinearAlgebra<T> for Tensor<T>

Source§

fn gpu_matmul(&self, other: &Self) -> RusTorchResult<Tensor<T>>

GPU matrix multiplication
Source§

fn gpu_batch_matmul(&self, other: &Self) -> RusTorchResult<Tensor<T>>

GPU batch matrix multiplication
Source§

fn gpu_matvec(&self, vector: &Self) -> RusTorchResult<Tensor<T>>

GPU matrix-vector multiplication
Source§

impl<T> GpuParallelOp<T> for Tensor<T>
where T: Float + Send + Sync + Clone + 'static + Debug + FromPrimitive + ScalarOperand,

Available on non-crate feature cuda only.
Source§

fn gpu_elementwise_op<F>( &self, other: &Tensor<T>, op: F, ) -> RusTorchResult<Tensor<T>>
where F: Fn(T, T) -> T + Send + Sync + Clone + 'static,

GPU上での並列要素ごと演算 Parallel element-wise operations on GPU
Source§

fn gpu_matmul(&self, other: &Tensor<T>) -> RusTorchResult<Tensor<T>>

GPU上での並列行列乗算 Parallel matrix multiplication on GPU
Source§

fn gpu_reduce<F, R>( &self, dim: usize, init: R, op: F, ) -> RusTorchResult<Tensor<T>>
where F: Fn(R, T) -> R + Send + Sync + Clone, R: Send + Sync + Clone + Into<T>,

Perform parallel reduction on GPU GPU上で並列リダクションを実行
Source§

fn to_device(&self, _device: DeviceType) -> RusTorchResult<Tensor<T>>

GPU-CPU間データ転送 Data transfer between GPU and CPU
Source§

fn to_cpu(&self) -> RusTorchResult<Tensor<T>>

Transfer tensor data from GPU to CPU テンソルデータをGPUからCPUに転送
Source§

impl<T: Float + FromPrimitive + ScalarOperand + 'static> GpuReduction<T> for Tensor<T>

Source§

fn gpu_sum(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU sum reduction
Source§

fn gpu_mean(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU mean reduction
Source§

fn gpu_max(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU max reduction
Source§

fn gpu_min(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU min reduction
Source§

fn gpu_std(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU standard deviation
Source§

fn gpu_var(&self, dim: Option<usize>) -> RusTorchResult<Tensor<T>>

GPU variance
Source§

impl<T: Float + 'static> Loadable for Tensor<T>

Source§

fn load_binary(data: &[u8]) -> SerializationResult<Self>

Load object from binary format バイナリ形式からオブジェクトを読み込み
Source§

fn expected_type_id() -> &'static str

Get expected type identifier 期待されるタイプ識別子を取得
Source§

fn validate_version(version: &str) -> SerializationResult<()>

Validate version compatibility バージョン互換性を検証
Source§

impl<T: Float + Send + Sync + Clone + 'static> MatrixParallelOp<T> for Tensor<T>

Source§

fn batch_matmul(&self, other: &Tensor<T>) -> RusTorchResult<Tensor<T>>

並列バッチ行列乗算 Parallel batch matrix multiplication
Source§

fn batch_conv2d( &self, kernel: &Tensor<T>, stride: usize, padding: usize, ) -> RusTorchResult<Tensor<T>>

並列畳み込み演算 Parallel convolution operation
Source§

impl<T: Float + Clone + 'static> MemoryOptimization<T> for Tensor<T>

Source§

fn memory_info(&self) -> TensorMemoryInfo

Get memory information about this tensor このテンソルのメモリ情報を取得
Source§

fn can_optimize_memory(&self) -> bool

Check if this tensor can be optimized for memory usage このテンソルがメモリ使用量を最適化できるかチェック
Source§

fn optimize_memory(&self) -> Self

Create a memory-optimized copy of this tensor このテンソルのメモリ最適化コピーを作成
Source§

fn try_optimize_memory(&self) -> RusTorchResult<Self>

Try to create a memory-optimized copy with error handling エラーハンドリング付きでメモリ最適化コピーを作成を試行
Source§

impl MixedPrecisionTensor<f32> for Tensor<f32>

Source§

fn cast_to(&self, dtype: DType) -> Tensor<f32>

Cast tensor to target dtype
Source§

fn can_cast_to(&self, dtype: DType) -> bool

Check if tensor can be safely cast to target dtype
Source§

fn memory_footprint(&self) -> usize

Get memory footprint in bytes
Source§

fn memory_footprint_for_dtype(&self, dtype: DType) -> usize

Get memory footprint for target dtype
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Mul<T> for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the * operator.
Source§

fn mul(self, scalar: T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Mul<T> for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the * operator.
Source§

fn mul(self, scalar: T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Mul for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Mul for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the * operator.
Source§

fn mul(self, other: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Neg for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Neg for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl<T: Float + Send + Sync + Clone + 'static> ParallelOp<T> for Tensor<T>

Tensorの並列操作実装 Parallel operations implementation for Tensor

Source§

const MIN_PARALLEL_SIZE: usize = 1_000usize

並列実行の最小サイズ閾値 Minimum size threshold for parallel execution
Source§

fn should_parallelize(&self, size: usize) -> bool

並列実行が効率的かどうかを判定 Determine if parallel execution is efficient
Source§

impl<T: Float + Send + Sync + Clone + 'static> ReductionParallelOp<T> for Tensor<T>

Source§

fn parallel_reduce<F, R>( &self, dim: usize, init: R, op: F, ) -> RusTorchResult<Tensor<T>>
where F: Fn(R, T) -> R + Send + Sync + Clone, R: Send + Sync + Clone + Into<T>,

並列リダクション演算 Parallel reduction operation
Source§

fn parallel_mean(&self, dim: usize) -> RusTorchResult<Tensor<T>>

並列平均 Parallel mean
Source§

fn parallel_sum(&self, dim: usize) -> RusTorchResult<Tensor<T>>

並列合計 Parallel sum
Source§

impl<T: Float + 'static> Saveable for Tensor<T>

Tensor serialization utilities テンソルシリアライゼーションユーティリティ

Source§

fn save_binary(&self) -> SerializationResult<Vec<u8>>

Save object to binary format オブジェクトをバイナリ形式で保存
Source§

fn type_id(&self) -> &'static str

Get object type identifier オブジェクトタイプ識別子を取得
Source§

fn metadata(&self) -> HashMap<String, String>

Get metadata for object オブジェクトのメタデータを取得
Source§

fn version(&self) -> String

Get version information バージョン情報を取得
Source§

impl<T: Float + Clone + 'static> ShapeOps<T> for Tensor<T>

Source§

fn shapes(self) -> ShapeBuilder<T>

Create shape builder for fluent operations フルエント操作のためのシェイプビルダーを作成

Source§

impl SimdParallelOp for Tensor<f32>

f32特化のSIMD並列操作実装 SIMD parallel operations implementation specialized for f32

Source§

fn simd_parallel_add(&self, other: &Tensor<f32>) -> RusTorchResult<Tensor<f32>>

SIMD最適化並列加算 SIMD-optimized parallel addition
Source§

fn simd_parallel_matmul( &self, other: &Tensor<f32>, ) -> RusTorchResult<Tensor<f32>>

SIMD最適化並列行列乗算 SIMD-optimized parallel matrix multiplication
Source§

fn simd_parallel_scalar_mul(&self, scalar: f32) -> Tensor<f32>

SIMD最適化並列スカラー乗算 SIMD-optimized parallel scalar multiplication
Source§

impl<T> SpecialFunctions<T> for Tensor<T>
where T: Float + Debug + 'static,

Implementation of special functions for Tensor

Source§

fn gamma(&self) -> RusTorchResult<Tensor<T>>

Gamma function Γ(x)
Source§

fn lgamma(&self) -> RusTorchResult<Tensor<T>>

Natural logarithm of gamma function ln(Γ(x))
Source§

fn digamma(&self) -> RusTorchResult<Tensor<T>>

Digamma function ψ(x) = d/dx ln(Γ(x))
Source§

fn erf(&self) -> RusTorchResult<Tensor<T>>

Error function erf(x)
Source§

fn erfc(&self) -> RusTorchResult<Tensor<T>>

Complementary error function erfc(x) = 1 - erf(x)
Source§

fn erfinv(&self) -> RusTorchResult<Tensor<T>>

Inverse error function erf^(-1)(x)
Source§

fn bessel_j(&self, n: T) -> RusTorchResult<Tensor<T>>

Bessel function of the first kind J_n(x)
Source§

fn bessel_y(&self, n: T) -> RusTorchResult<Tensor<T>>

Bessel function of the second kind Y_n(x)
Source§

fn bessel_i(&self, n: T) -> RusTorchResult<Tensor<T>>

Modified Bessel function of the first kind I_n(x)
Source§

fn bessel_k(&self, n: T) -> RusTorchResult<Tensor<T>>

Modified Bessel function of the second kind K_n(x)
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Sub<T> for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the - operator.
Source§

fn sub(self, scalar: T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Sub<T> for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the - operator.
Source§

fn sub(self, scalar: T) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Sub for &Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Float + 'static + ScalarOperand + FromPrimitive> Sub for Tensor<T>

Source§

type Output = Tensor<T>

The resulting type after applying the - operator.
Source§

fn sub(self, other: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Float + Clone + 'static> TensorIterOps<T> for Tensor<T>

Source§

fn iter<'a>(&'a self) -> impl Iterator<Item = &'a T>
where T: 'a,

Get an iterator over tensor elements (zero-copy) テンソル要素のイテレータを取得(ゼロコピー)
Source§

fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &'a mut T>
where T: 'a,

Get a mutable iterator over tensor elements (zero-copy) テンソル要素の可変イテレータを取得(ゼロコピー)
Source§

impl<T: Float + Quantizable<QuantizedType = i8>> TensorQuantization<T> for Tensor<T>

Source§

fn quantize_dynamic( &self, scheme: QuantizationScheme, ) -> RusTorchResult<QuantizedTensor<i8>>

Perform dynamic quantization 動的量子化を実行
Source§

fn quantize_static( &self, scale: f32, zero_point: i32, ) -> RusTorchResult<QuantizedTensor<i8>>

Perform static quantization with pre-computed parameters 事前計算されたパラメータでの静的量子化を実行
Source§

fn can_quantize(&self) -> bool

Check if tensor is suitable for quantization テンソルが量子化に適しているかチェック
Source§

impl<T: Float + Clone + 'static> ZeroAllocShapeOps<T> for Tensor<T>

Source§

fn try_squeeze_view(&self) -> RusTorchResult<Tensor<T>>

Attempt zero-copy squeeze ゼロコピーsqueezeを試行
Source§

fn try_unsqueeze_view(&self, dim: usize) -> RusTorchResult<Tensor<T>>

Attempt zero-copy unsqueeze ゼロコピーunsqueezeを試行
Source§

impl<T: Float + Clone + 'static + ScalarOperand> ZeroCopyOps<T> for Tensor<T>

Source§

fn inplace_add(&mut self, other: &Tensor<T>) -> RusTorchResult<()>

In-place addition with another tensor 他のテンソルとの in-place 加算
Source§

fn inplace_sub(&mut self, other: &Tensor<T>) -> RusTorchResult<()>

In-place subtraction with another tensor 他のテンソルとの in-place 減算
Source§

fn inplace_mul(&mut self, other: &Tensor<T>) -> RusTorchResult<()>

In-place multiplication with another tensor 他のテンソルとの in-place 乗算
Source§

fn inplace_mul_scalar(&mut self, scalar: T)

In-place scalar multiplication スカラーとの in-place 乗算
Source§

fn inplace_add_scalar(&mut self, scalar: T)

In-place scalar addition スカラーとの in-place 加算
Source§

fn inplace_apply<F>(&mut self, f: F) -> RusTorchResult<()>
where F: Fn(T) -> T + Send + Sync,

In-place element-wise function application 要素ごとの関数の in-place 適用
Source§

fn slice_view(&self, ranges: &[Range<usize>]) -> RusTorchResult<Tensor<T>>

Create a zero-copy view of a tensor slice テンソルスライスのゼロコピービューを作成
Source§

fn shares_memory_with(&self, other: &Tensor<T>) -> bool

Check if this tensor shares memory with another tensor このテンソルが他のテンソルとメモリを共有しているかチェック
Source§

fn detach(&self) -> Tensor<T>

Create a copy that doesn’t share memory (ensures no zero-copy aliasing) メモリを共有しないコピーを作成(ゼロコピーエイリアシングを確実に回避)

Auto Trait Implementations§

§

impl<T> Freeze for Tensor<T>

§

impl<T> RefUnwindSafe for Tensor<T>
where T: RefUnwindSafe,

§

impl<T> Send for Tensor<T>
where T: Send,

§

impl<T> Sync for Tensor<T>
where T: Sync,

§

impl<T> Unpin for Tensor<T>

§

impl<T> UnwindSafe for Tensor<T>
where T: RefUnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V