code: def test_filter_variable():
      # Test that filter_variable accepts more restrictive broadcast
      gpu_row = GpuArrayType(
          dtype=theano.config.floatX, broadcastable=(True, False)
      )
      gpu_matrix = GpuArrayType(
          dtype=theano.config.floatX, broadcastable=(False, False)
      )
      r = gpu_row()
      m = gpu_matrix.filter_variable(r)
      assert m.type == gpu_matrix
  
      # On CPU as well
      r = theano.tensor.row()
      m = gpu_matrix.filter_variable(r)
      assert m.type == gpu_matrix
  
imports: from __future__ import absolute_import, print_function, division
  import os
  import nose
  import numpy
  import theano
  from theano.compat import PY3
  from theano import config
  from theano.compile import DeepCopyOp, Rebroadcast, ViewOp
  from theano.misc.pkl_utils import CompatUnpickler
  from .config import test_ctx_name
  from .test_basic_ops import rand_gpuarray
  from ..type import GpuArrayType, gpuarray_shared_constructor
  import pygpu
label_desc: Use image node_id 7 for calling a global function with example usage: test_filter_variable() without return types