class_docstr: Computes the similarity graph from a set of (dense) embeddings.
docstr: Returns the bucket ID of the given `embedding` relative to `lsh_matrix`.
  
  Args:
    lsh_matrix: A random matrix of vectors for computing LSH buckets.
    embedding: A 1-D vector representing the dense embedding for a point.
  
  Returns:
    The bucket ID, a value in `[0, 2^n)`, where `n = self.config.lsh_splits`.
    Bit `i` of the result (where bit 0 corresponds to the least significant
    bit) is 1 if and only if the dot product of row `i` of `lsh_matrix' and
    `embedding` is positive.
docstr_tok: ["Returns","the","bucket","ID","of","the","given","`","embedding","`","relative","to","`","lsh_matrix","`",".","Args",":","lsh_matrix",":","A","random","matrix","of","vectors","for","computing","LSH","buckets",".","embedding",":","A","1-D","vector","representing","the","dense","embedding","for","a","point",".","Returns",":","The","bucket","ID",",","a","value","in","`","[","0",",","2^n",")","`",",","where","`","n","=","self.config.lsh_splits","`",".","Bit","`","i","`","of","the","result","(","where","bit","0","corresponds","to","the","least","significant","bit",")","is","1","if","and","only","if","the","dot","product","of","row","`","i","`","of","`","lsh_matrix","'","and","`","embedding","`","is","positive","."]
code: def _bucket(self, lsh_matrix, embedding):
      """Returns the bucket ID of the given `embedding` relative to `lsh_matrix`.
  
      Args:
        lsh_matrix: A random matrix of vectors for computing LSH buckets.
        embedding: A 1-D vector representing the dense embedding for a point.
  
      Returns:
        The bucket ID, a value in `[0, 2^n)`, where `n = self.config.lsh_splits`.
        Bit `i` of the result (where bit 0 corresponds to the least significant
        bit) is 1 if and only if the dot product of row `i` of `lsh_matrix' and
        `embedding` is positive.
      """
      bucket = 0
      mask = 1
      for x in np.matmul(lsh_matrix, embedding):
          if x > 0.0:
              bucket = bucket | mask
          mask = mask << 1
      return bucket
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  import time
  from absl import app
  from absl import flags
  from absl import logging
  import neural_structured_learning.configs
  import numpy
  import six
  import tensorflow
label_desc: Use image node_id 3 for calling the GraphBuilder obj's underlying member method code with example usage: obj._bucket(lsh_matrix, embedding) and returns: bucket