class_docstr: Generates values of X between A & B to invoke on an external predicate F(X) to
  discover the largest X for which F(X) is true. Uses binary search to minimize the
  number of invocations of F. Assumes F is a step function, i.e. if F(X) is false,
  there is no point trying F(X+1).
class_docstr_tok: ["Generates","values","of","X","between","A","&","B","to","invoke","on","an","external","predicate","F","(","X",")","to","discover","the","largest","X","for","which","F","(","X",")","is","true",".","Uses","binary","search","to","minimize","the","number","of","invocations","of","F.","Assumes","F","is","a","step","function",",","i.e",".","if","F","(","X",")","is","false",",","there","is","no","point","trying","F","(","X+1",")","."]
code: def _mid(self) -> int:
      return self.left + ((self.right - self.left) // 2)
  
file_path: torchrec/torchrec/distributed/planner/utils.py
imports: import operator
  from functools import reduce
  from typing import Any, cast, Dict, Iterable, List, Optional, Type, Union
  import torch
  from torchrec.distributed.planner.types import Perf, ShardingOption, Storage
  from torchrec.distributed.types import ShardingType
label_desc: Use image node_id 3 for calling the BinarySearchPredicate obj's underlying member method code with example usage: obj._mid() and returns: unknown