docstr: Returns a dataset made from `tensor`. To be called in a dataset_fn.
docstr_tok: ["Returns","a","dataset","made","from","`","tensor","`",".","To","be","called","in","a","dataset_fn","."]
code: def makeDatasetFromTensorWithoutUsingResource(
      self, input_context, tensor
  ):
      """Returns a dataset made from `tensor`. To be called in a dataset_fn."""
      global_batch_size = 24
      batch_size = input_context.get_per_replica_batch_size(
          global_batch_size
      )
      dataset = (
          dataset_ops.DatasetV2.from_tensors(tensor)
          .repeat()
          .batch(batch_size, drop_remainder=True)
      )
      dataset = dataset.shard(
          input_context.num_input_pipelines,
          input_context.input_pipeline_id,
      )
      dataset = dataset.prefetch(
          2
      )  # This prefetches 2 batches per device.
      return dataset
  
imports: import copy
  import os
  from absl.testing import parameterized
  from tensorflow.python.compat import v2_compat
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.distribute import combinations
  from tensorflow.python.distribute import device_util
  from tensorflow.python.distribute import multi_process_runner
  from tensorflow.python.distribute import multi_worker_test_base
  from tensorflow.python.distribute import parameter_server_strategy_v2
  from tensorflow.python.distribute import ps_values
  from tensorflow.python.distribute.coordinator import cluster_coordinator
  from tensorflow.python.distribute.coordinator import coordinator_context
  from tensorflow.python.eager import def_function
  from tensorflow.python.eager import test
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import tensor_spec
  from tensorflow.python.module import module
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import lookup_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.saved_model import load
  from tensorflow.python.saved_model import save
label_desc: Use image node_id 5 for calling the DistributedTableTest obj's underlying member method code with example usage: obj.makeDatasetFromTensorWithoutUsingResource(input_context, tensor) and returns: dataset