class_docstr: Returns the ps task index for placement using a hash of the op name.
docstr: Choose a ps task index for the given `Operation`.
  
  Hashes the op name and assigns it to a ps task modulo the number of tasks.
  This ensures that variables with the same name are always placed on the same
  parameter server.
  
  Args:
    op: An `Operation` to be placed on ps.
  
  Returns:
    The ps task index to use for the `Operation`.
code: def __call__(self, op):
      """Choose a ps task index for the given `Operation`.
  
      Hashes the op name and assigns it to a ps task modulo the number of tasks.
      This ensures that variables with the same name are always placed on the same
      parameter server.
  
      Args:
        op: An `Operation` to be placed on ps.
  
      Returns:
        The ps task index to use for the `Operation`.
      """
  
      hashed = int(
          hashlib.sha256(op.name.encode("utf-8")).hexdigest(), 16
      )
      return hashed % self._num_tasks
  
file_path: adanet/adanet/distributed/devices.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import contextlib
  import hashlib
label_desc: Use image node_id 2 for calling the _OpNameHashStrategy obj's underlying member method code with example usage: obj.__call__(op) and returns: unknown