def _build_placeholder(self, ndarray, dtype=None):
dtype = dtype if dtype is not None else self.dtype<EOL>ndarray = np.asarray(ndarray).astype(dtype)<EOL>return tf.compat.v1.placeholder_with_default(<EOL>input=ndarray, shape=ndarray.shape if self.use_static_shape else None)<EOL>
Convert a numpy array to a TF placeholder.

        Args:
          ndarray: any object convertible to a numpy array via `np.asarray()`.
          dtype: numpy `dtype` of the returned placeholder. If `None`, uses
            the default `self.dtype`.

        Returns:
          placeholder: a TensorFlow `placeholder` with default value given by the
          provided `ndarray`, dtype given by `self.dtype`, and shape specified
          statically only if `self.use_static_shape` is `True`.