MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / convert_to_int_tensor

Function convert_to_int_tensor

tensorflow/python/ops/array_ops.py:4813–4821  ·  view source on GitHub ↗

Converts the given value to an integer Tensor.

(tensor, name, dtype=dtypes.int32)

Source from the content-addressed store, hash-verified

4811
4812
4813def convert_to_int_tensor(tensor, name, dtype=dtypes.int32):
4814 """Converts the given value to an integer Tensor."""
4815 tensor = ops.convert_to_tensor(tensor, name=name, preferred_dtype=dtype)
4816 if tensor.dtype.is_integer:
4817 tensor = gen_math_ops.cast(tensor, dtype)
4818 else:
4819 raise TypeError("%s must be an integer tensor; dtype=%s" %
4820 (name, tensor.dtype))
4821 return tensor
4822
4823
4824def get_positive_axis(axis, ndims):

Callers 1

repeat_with_axisFunction · 0.85

Calls 1

castMethod · 0.45

Tested by

no test coverage detected