예제 #1
0
파일: batching.py 프로젝트: qwerzou1/shibie
 def batch_init_fn(_):
   indices_shape = array_ops.concat([[0], [array_ops.size(padded_shape) + 1]],
                                    0)
   return sparse_tensor.SparseTensor(
       indices=gen_array_ops.empty(indices_shape, dtype=dtypes.int64),
       values=constant_op.constant([], shape=[0], dtype=dataset.output_types),
       dense_shape=array_ops.concat(
           [np.array([0], dtype=np.int64), padded_shape], 0))
예제 #2
0
 def batch_init_fn(_):
   indices_shape = array_ops.concat([[0], [array_ops.size(padded_shape) + 1]],
                                    0)
   return sparse_tensor.SparseTensor(
       indices=gen_array_ops.empty(indices_shape, dtype=dtypes.int64),
       values=constant_op.constant([], shape=[0], dtype=dataset.output_types),
       dense_shape=array_ops.concat(
           [np.array([0], dtype=np.int64), padded_shape], 0))
예제 #3
0
 def batch_init_fn(_):
   indices_shape = array_ops.concat([[0], [array_ops.size(shape) + 1]], 0)
   return sparse_tensor.SparseTensor(
       indices=gen_array_ops.empty(indices_shape, dtype=dtypes.int64),
       values=constant_op.constant(
           [], shape=[0], dtype=dataset_ops.get_legacy_output_types(dataset)),
       dense_shape=array_ops.concat(
           [np.array([0], dtype=np.int64),
            math_ops.cast(shape, dtypes.int64)], 0))
예제 #4
0
 def batch_init_fn(_):
   indices_shape = array_ops.concat([[0], [array_ops.size(shape) + 1]], 0)
   return sparse_tensor.SparseTensor(
       indices=gen_array_ops.empty(indices_shape, dtype=dtypes.int64),
       values=constant_op.constant(
           [], shape=[0], dtype=dataset_ops.get_legacy_output_types(dataset)),
       dense_shape=array_ops.concat(
           [np.array([0], dtype=np.int64),
            math_ops.cast(shape, dtypes.int64)], 0))
예제 #5
0
def empty_like(x, init=None):
  """Returns a non-initialized tensor with the same shape and dtype as x.

  Args:
    x: A Tensor.
    init: Initialize the returned tensor with the default value of
      x.dtype(), if True. Otherwise, do not initialize. Defaults to
      None.

  Returns:
    A tensor y, whose dtype and shape are the same as those of x.
    y is guaranteed not to be an alias of x. Upon return, y may contain
    arbitrary data.

  """
  x = ops.convert_to_tensor(x)
  return gen_array_ops.empty(array_ops.shape(x), x.dtype, init=init)
예제 #6
0
def empty_like(x, init=None):
  """Returns a non-initialized tensor with the same shape and dtype as x.

  Args:
    x: A Tensor.
    init: Initialize the returned tensor with the default value of
      x.dtype(), if True. Otherwise, do not initialize. Defaults to
      None.

  Returns:
    A tensor y, whose dtype and shape are the same as those of x.
    y is guaranteed not to be an alias of x. Upon return, y may contain
    arbitrary data.

  """
  x = ops.convert_to_tensor(x)
  return gen_array_ops.empty(array_ops.shape(x), x.dtype, init=init)
예제 #7
0
 def batch_init_fn(_):
   batch_shape = array_ops.concat([[0], shape], 0)
   return gen_array_ops.empty(batch_shape, dtype=dataset.output_types)
예제 #8
0
 def batch_init_fn(_):
   batch_shape = array_ops.concat([[0], shape], 0)
   return gen_array_ops.empty(
       batch_shape, dtype=dataset_ops.get_legacy_output_types(dataset))
예제 #9
0
 def batch_init_fn(_):
   batch_shape = array_ops.concat(
       [np.array([0], dtype=np.int32), padded_shape], 0)
   return gen_array_ops.empty(batch_shape, dtype=dataset_output_types)
예제 #10
0
 def batch_init_fn(_):
   batch_shape = array_ops.concat(
       [np.array([0], dtype=np.int32), padded_shape], 0)
   return gen_array_ops.empty(batch_shape, dtype=dataset.output_types)