def __init__(self, axis=0, prepend=None, append=None): if prepend is not None: prepend = cde.Tensor(np.array(prepend)) if append is not None: append = cde.Tensor(np.array(append)) super().__init__(axis, prepend, append)
def __init__(self, fill_value): super().__init__(cde.Tensor(np.array(fill_value)))
def __init__(self, operator, constant, dtype=mstype.bool_): dtype = mstype_to_detype(dtype) constant = cde.Tensor(np.array(constant)) super().__init__(DE_C_RELATIONAL[operator], constant, dtype)
def __init__(self, pad_shape, pad_value=None): if pad_value is not None: pad_value = cde.Tensor(np.array(pad_value)) super().__init__(cde.TensorShape(pad_shape), pad_value)
def test_basic(): x = np.array([["ab", "cde", "121"], ["x", "km", "789"]], dtype='S') n = cde.Tensor(x) arr = n.as_array() np.testing.assert_array_equal(x, arr)
def __init__(self, axis=0, prepend=None, append=None): self.axis = axis self.prepend = cde.Tensor( np.array(prepend)) if prepend is not None else prepend self.append = cde.Tensor( np.array(append)) if append is not None else append
def __init__(self, pad_shape, pad_value=None): self.pad_shape = cde.TensorShape(pad_shape) self.pad_value = cde.Tensor( np.array(pad_value)) if pad_value is not None else pad_value
def __init__(self, operator, constant, dtype=mstype.bool_): self.operator = operator self.dtype = mstype_to_detype(dtype) self.constant = cde.Tensor(np.array(constant))
def __init__(self, fill_value): self.fill_value = cde.Tensor(np.array(fill_value))