class_docstr: Linear Elliptical Slice Sampler.
  
  Ideas:
  - Add batch support, broadcasting over parallel chains.
  - Optimize computations if possible, potentially with torch.compile.
  - Extend fixed features constraint to general linear equality constraints.
class_docstr_tok: ["Linear","Elliptical","Slice","Sampler",".","Ideas",":","-","Add","batch","support",",","broadcasting","over","parallel","chains",".","-","Optimize","computations","if","possible",",","potentially","with","torch.compile",".","-","Extend","fixed","features","constraint","to","general","linear","equality","constraints","."]
docstr: Find angles of those intersections that are at the boundary of the integration
  domain by adding and subtracting a small angle and evaluating on the ellipse
  to see if we are on the boundary of the integration domain.
  
  Args:
      nu: A `d x 1`-dim tensor (the "new" direction, drawn from N(0, I)).
  
  Returns:
      A `num_active`-dim tensor containing the angles of active intersection in
      increasing order so that activation happens in positive direction. If a
      slice crosses `theta=0`, the first angle is appended at the end of the
      tensor. Every element of the returned tensor defines a slice for elliptical
      slice sampling.
docstr_tok: ["Find","angles","of","those","intersections","that","are","at","the","boundary","of","the","integration","domain","by","adding","and","subtracting","a","small","angle","and","evaluating","on","the","ellipse","to","see","if","we","are","on","the","boundary","of","the","integration","domain",".","Args",":","nu",":","A","`","d","x","1","`","-dim","tensor","(","the","``","new","''","direction",",","drawn","from","N","(","0",",","I",")",")",".","Returns",":","A","`","num_active","`","-dim","tensor","containing","the","angles","of","active","intersection","in","increasing","order","so","that","activation","happens","in","positive","direction",".","If","a","slice","crosses","`","theta=0","`",",","the","first","angle","is","appended","at","the","end","of","the","tensor",".","Every","element","of","the","returned","tensor","defines","a","slice","for","elliptical","slice","sampling","."]
code: def _find_active_intersections(self, nu: Tensor) -> Tensor:
      """
      Find angles of those intersections that are at the boundary of the integration
      domain by adding and subtracting a small angle and evaluating on the ellipse
      to see if we are on the boundary of the integration domain.
  
      Args:
          nu: A `d x 1`-dim tensor (the "new" direction, drawn from N(0, I)).
  
      Returns:
          A `num_active`-dim tensor containing the angles of active intersection in
          increasing order so that activation happens in positive direction. If a
          slice crosses `theta=0`, the first angle is appended at the end of the
          tensor. Every element of the returned tensor defines a slice for elliptical
          slice sampling.
      """
      theta = self._find_intersection_angles(nu)
      theta_active, delta_active = self._active_theta_and_delta(
          nu=nu,
          theta=theta,
      )
      if theta_active.numel() == 0:
          theta_active = self._full_angular_range
          # TODO: What about `self.ellipse_in_domain = False` in the original code?
      elif (
          delta_active[0] == -1
      ):  # ensuring that the first interval is feasible
          theta_active = torch.cat((theta_active[1:], theta_active[:1]))
  
      return theta_active.view(-1)
  
imports: from __future__ import annotations
  import math
  from typing import List, Optional, Tuple, Union
  import torch
  from botorch.utils.sampling import PolytopeSampler
  from torch import Tensor
label_desc: Use image node_id 10 for calling the LinearEllipticalSliceSampler obj's underlying member method code with example usage: obj._find_active_intersections(nu) and returns: theta_active