class_docstr: Tests serializing Observable operators using the ``compare()`` method.
class_docstr_tok: ["Tests","serializing","Observable","operators","using","the","``","compare","(",")","``","method","."]
docstr: Test that DatasetOperator can be initialized from a HDF5 group
  that contains a operator attribute.
docstr_tok: ["Test","that","DatasetOperator","can","be","initialized","from","a","HDF5","group","that","contains","a","operator","attribute","."]
code: def test_bind_init(self, obs_in):
      """Test that DatasetOperator can be initialized from a HDF5 group
      that contains a operator attribute."""
      bind = DatasetOperator(obs_in).bind
  
      dset_op = DatasetOperator(bind=bind)
  
      assert dset_op.info["type_id"] == "operator"
      assert dset_op.info["py_type"] == get_type_str(type(obs_in))
  
      obs_out = dset_op.get_value()
      assert repr(obs_out) == repr(obs_in)
      assert obs_in.compare(obs_out)
  
file_path: pennylane/tests/data/attributes/operator/test_operator.py
imports: import itertools
  import numpy
  import pytest
  import pennylane
  from pennylane.data.attributes import DatasetOperator
  from pennylane.data.base.typing_util import get_type_str
  from pennylane.operation import Operator, Tensor
label_desc: Use image node_id 2 for calling the TestDatasetOperatorObservable obj's underlying member method code with example usage: obj.test_bind_init(obs_in) without return types