def tensor_list_stack(input_handle, element_dtype, num_elements=-1, name=None): return gen_list_ops.tensor_list_stack( input_handle=input_handle, element_shape=-1, element_dtype=element_dtype, num_elements=num_elements, name=name)
def tensor_list_stack(input_handle, element_dtype, num_elements=-1, element_shape=None, name=None): return gen_list_ops.tensor_list_stack( input_handle=input_handle, element_shape=_build_element_shape(element_shape), element_dtype=element_dtype, num_elements=num_elements, name=name)
def _TensorListFromTensor(op, dlist): if op.inputs[0].shape[0] is not None: num_elements = op.inputs[0].shape[0] else: num_elements = None if dlist is None: dlist = gen_list_ops.empty_tensor_list( element_dtype=op.inputs[0].dtype, element_shape=-1) return gen_list_ops.tensor_list_stack(dlist, element_dtype=op.inputs[0].dtype, num_elements=num_elements)
def _TensorListFromTensor(op, dlist): if op.inputs[0].shape[0] is not None: num_elements = op.inputs[0].shape[0] else: num_elements = None if dlist is None: dlist = gen_list_ops.empty_tensor_list( element_dtype=op.inputs[0].dtype, element_shape=-1) return gen_list_ops.tensor_list_stack( dlist, element_dtype=op.inputs[0].dtype, num_elements=num_elements)
def _TensorListFromTensorGrad(op, dlist): """Gradient for TensorListFromTensor.""" if op.inputs[0].shape[0] is not None: num_elements = op.inputs[0].shape[0] else: num_elements = None if dlist is None: dlist = gen_list_ops.empty_tensor_list( element_dtype=op.inputs[0].dtype, element_shape=gen_list_ops.tensor_list_element_shape( op.outputs[0], shape_type=dtypes.int32)) return gen_list_ops.tensor_list_stack(dlist, element_dtype=op.inputs[0].dtype, num_elements=num_elements)
def _TensorListFromTensorGrad(op, dlist): """Gradient for TensorListFromTensor.""" if op.inputs[0].shape[0] is not None: num_elements = op.inputs[0].shape[0] else: num_elements = None if dlist is None: dlist = gen_list_ops.empty_tensor_list( element_dtype=op.inputs[0].dtype, element_shape=gen_list_ops.tensor_list_element_shape( op.outputs[0], shape_type=dtypes.int32)) return gen_list_ops.tensor_list_stack( dlist, element_dtype=op.inputs[0].dtype, num_elements=num_elements)
def _TensorListFromTensorGrad(op, dlist): """Gradient for TensorListFromTensor.""" if op.inputs[0].shape.dims and op.inputs[0].shape.dims[0].value is not None: num_elements = op.inputs[0].shape.dims[0].value else: num_elements = None if dlist is None: dlist = empty_tensor_list( element_dtype=op.inputs[0].dtype, element_shape=gen_list_ops.tensor_list_element_shape( op.outputs[0], shape_type=dtypes.int32)) tensor_grad = gen_list_ops.tensor_list_stack( dlist, element_dtype=op.inputs[0].dtype, num_elements=num_elements) shape_grad = None return tensor_grad, shape_grad
def _TensorListFromTensorGrad(op, dlist): """Gradient for TensorListFromTensor.""" if op.inputs[0].shape.dims and op.inputs[0].shape.dims[0].value is not None: num_elements = op.inputs[0].shape.dims[0].value else: num_elements = None if dlist is None: dlist = empty_tensor_list( element_dtype=op.inputs[0].dtype, element_shape=gen_list_ops.tensor_list_element_shape( op.outputs[0], shape_type=dtypes.int32)) tensor_grad = gen_list_ops.tensor_list_stack( dlist, element_dtype=op.inputs[0].dtype, num_elements=num_elements) shape_grad = None return tensor_grad, shape_grad