def METHOD_NAME(self, data, layer_name, layout, precision, template=None):
    if np.ndim(data) == 3 and len(self.inputs[layer_name]['shape']) == 4:
        data = np.expand_dims(data, -1)
    if layout is not None and len(np.shape(data)) == len(layout):
        data = np.transpose(data, layout)
    else:
        data = np.array(data)
    precision = self.tf.as_dtype(precision) if precision else self.inputs[layer_name]['precision']
    return self.tf.convert_to_tensor(data, dtype=precision)