torch.Tensor.Tensor.arcsinh_
Tensor.arcsinh_(): thisIn-place inverse hyperbolic sine (arcsinh).
Computes the inverse hyperbolic sine of each element in-place. Unlike arcsin, arcsinh accepts any real value (no input restrictions). Element-wise: y = arcsinh(x) = ln(x + √(x² + 1)).
Use Cases:
- Inverse of sinh activations
- Unbounded-to-bounded transformations
- Signal processing with hyperbolic functions
- Normalizing outputs in specific scales
- Input range: Any real number (no restrictions).
- Numerically stable: Works well for large input values.
- In-place: Modifies tensor directly, more memory efficient.
- Alias: PyTorch calls this
asinh_(), this is thearcsinh_()alias.
Returns
this– This tensor, modified in-placeExamples
const x = torch.tensor([0, 1, -1]);
x.arcsinh_(); // [0, 0.881, -0.881]
// No input restrictions - works for any value
const unbounded = torch.tensor([-1000, 0, 1000]);
unbounded.arcsinh_(); // Still numerically stable
// Inverse of sinh
const sinhValues = torch.tensor([0, 1, -1]);
const original = sinhValues.clone().arcsinh_();