class_docstr: A class to support adding sharding attributes to Ops.
  
  Use the factory constructors and then call apply_to_tensor:
    Sharding.replicate().apply_to_tensor(tensor)
docstr: Returns an AssignDevice sharding attribute.
  
  This causes an op to be computed in its entirety only on one core in
  the XLA device.
  Args:
    core: The core to assign this Op to.
docstr_tok: ["Returns","an","AssignDevice","sharding","attribute",".","This","causes","an","op","to","be","computed","in","its","entirety","only","on","one","core","in","the","XLA","device",".","Args",":","core",":","The","core","to","assign","this","Op","to","."]
code: def assign_device(cls, core):
      """Returns an AssignDevice sharding attribute.
  
      This causes an op to be computed in its entirety only on one core in
      the XLA device.
      Args:
        core: The core to assign this Op to.
      """
      return Sharding(
          proto=xla_data_pb2.OpSharding(
              type=xla_data_pb2.OpSharding.MAXIMAL,
              tile_assignment_dimensions=[1],
              tile_assignment_devices=[core],
          )
      )
  
imports: import numpy
  from tensorflow.compiler.tf2xla.python import xla
  from local_xla.xla import xla_data_pb2
  from tensorflow.core.framework import attr_value_pb2
label_desc: Use image node_id 4 for calling the Sharding obj's underlying member method code with example usage: obj.assign_device(cls, core) and returns: Sharding