torch.Tensor.Tensor.arccosh_
Tensor.arccosh_(): thisIn-place inverse hyperbolic cosine (arccosh).
Computes the inverse hyperbolic cosine of each element in-place. The input must be ≥ 1 for real-valued outputs. Element-wise: y = arccosh(x) = ln(x + √(x² - 1)).
Use Cases:
- Inverse of cosh activations
- Range restriction to [1, ∞)
- Signal processing with hyperbolic functions
- Numerical transformations in specific domains
- Input range: Input must be ≥ 1 for real output.
- Output range: Output is in [0, ∞).
- In-place: Modifies tensor directly, more memory efficient.
- Alias: PyTorch calls this
acosh_(), this is thearccosh_()alias.
Returns
this– This tensor, modified in-placeExamples
const x = torch.tensor([1, 2, 3]);
x.arccosh_(); // [0, 1.317, 1.763]
// Input must be >= 1
const valid = torch.tensor([1, 1.5, 2, 5, 10]);
valid.arccosh_(); // Works fine
// Values < 1 produce NaN
const invalid = torch.tensor([0.5]);
invalid.arccosh_(); // Results in NaN
// Inverse of cosh
const coshValues = torch.tensor([1, 2, 5]);
const original = coshValues.clone().arccosh_();