code: def test_sequence_unpack_basic(device_id):
      dev = cntk_device(device_id)
  
      # Unpack a placeholder
      p = C.placeholder()
      p_unpacked_outputs = C.sequence.unpack(p, padding_value=0).outputs
      assert len(p_unpacked_outputs) == 2
  
      x = C.input_variable((C.FreeDimension, 2, 3), is_sparse=False)
      x_seq_lens = C.input_variable(())
      x_seq = C.to_sequence(x, x_seq_lens)
      x_seq_unpacked = C.sequence.unpack(x_seq, padding_value=-1000.0)
      x_seq_unpacked_value_output = x_seq_unpacked.outputs[0]
      x_seq_unpacked_mask_output = x_seq_unpacked.outputs[1]
      assert len(x_seq_unpacked_value_output.dynamic_axes) == 1
      assert x_seq_unpacked_value_output.shape == (
          C.FreeDimension,
          2,
          3,
      )
  
      seq1_data = [[[0, 1, 1], [0, 1, 0]], [[1, 0, 0], [1, 0, 1]]]
      seq2_data = [[0, 1, 1], [1, 1, 0]]
      x_data = [
          np.asarray(seq1_data, dtype=np.float32),
          np.asarray(
              [
                  seq2_data,
                  [[-100.0, -100.0, -100.0], [-100.0, -100.0, -100.0]],
              ],
              dtype=np.float32,
          ),
      ]
      x_seq_lens_data = np.asarray([2, 1], dtype=np.float32)
      result = x_seq_unpacked.eval(
          {x: x_data, x_seq_lens: x_seq_lens_data}, device=dev
      )
      value = result[x_seq_unpacked_value_output]
      mask = result[x_seq_unpacked_mask_output]
      assert np.array_equal(value[0], seq1_data)
      assert np.array_equal(
          value[1],
          [
              seq2_data,
              [
                  [-1000.0, -1000.0, -1000.0],
                  [-1000.0, -1000.0, -1000.0],
              ],
          ],
      )
      assert np.array_equal(mask, [[1, 1], [1, 0]])
  
imports: from __future__ import division
  import numpy
  import pytest
  import cntk
  from .ops_test_utils import cntk_device
  from cntk.tests.test_utils import _to_dense, _to_csr
  from .ops_test_utils import unittest_helper, _test_unary_op, _test_binary_op, AA, precision, PRECISION_TO_TYPE, cntk_device
  from cntk import Value
  from cntk.axis import Axis
  from cntk.internal import sanitize_dtype_cntk
  from ..None import constant
label_desc: Use image node_id 13 for calling a global function with example usage: test_sequence_unpack_basic(device_id) without return types