def get_in_out_tensors(graph):
	"""
	Get the input and output tensors from the TensorFlow graph 'graph'.
	"""
	# Get the graph nodes that perform computation on tensors
	ops = graph.get_operations()
	# Initialize input and output tensors
	inputs = []
	outputs_set = set(ops)
	# Process operations
	for op in ops:
		# The input nodes are nodes without input
		if len(op.inputs) == 0 and op.type != 'Const':
			inputs.append(op)
		# The output nodes are nodes without output
		else:
			for input_tensor in op.inputs:
				if input_tensor.op in outputs_set:
					outputs_set.remove(input_tensor.op)
	outputs = list(outputs_set)
	return inputs, outputs